From: Bruce Richardson Date: Tue, 16 Dec 2014 15:03:49 +0000 (+0000) Subject: app/test: fix crash after null check X-Git-Tag: spdx-start~9930 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b38e6ee0fa7508b81753cedb1d6b121f2dee32fe;p=dpdk.git app/test: fix crash after null check In the kvargs test cases, we were checking for errors by checking if the returned pointer value was NULL. In the error handling, we then tried to free back the NULL pointer, which would cause a crash. Signed-off-by: Bruce Richardson --- diff --git a/app/test/test_kvargs.c b/app/test/test_kvargs.c index b8f5e5ce2b..6be85122d1 100644 --- a/app/test/test_kvargs.c +++ b/app/test/test_kvargs.c @@ -78,7 +78,6 @@ static int test_valid_kvargs(void) kvlist = rte_kvargs_parse(args, valid_keys); if (kvlist == NULL) { printf("rte_kvargs_parse() error"); - rte_kvargs_free(kvlist); goto fail; } rte_kvargs_free(kvlist); @@ -89,7 +88,6 @@ static int test_valid_kvargs(void) kvlist = rte_kvargs_parse(args, valid_keys); if (kvlist == NULL) { printf("rte_kvargs_parse() error"); - rte_kvargs_free(kvlist); goto fail; } /* call check_handler() for all entries with key="check" */ @@ -150,7 +148,6 @@ static int test_valid_kvargs(void) kvlist = rte_kvargs_parse(args, valid_keys); if (kvlist == NULL) { printf("rte_kvargs_parse() error"); - rte_kvargs_free(kvlist); goto fail; } /* call check_handler() on all entries with key="check", it