test: add missing cleanup to one of the failure paths

Message ID 9c2fc1a970820a780ecf050bb8b669d9bcd64e7b.1541677243.git.anatoly.burakov@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series test: add missing cleanup to one of the failure paths |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Burakov, Anatoly Nov. 8, 2018, 11:44 a.m. UTC
  One of the failure paths were not updated to clean up on exit,
most likely due to rebase error. Fix the failure path to clean
up instead of simply exiting.

Fixes: 3f9e31d71d63 ("test: clean up on exit")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 test/test/test.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon Nov. 14, 2018, 3:58 a.m. UTC | #1
08/11/2018 12:44, Anatoly Burakov:
> One of the failure paths were not updated to clean up on exit,
> most likely due to rebase error. Fix the failure path to clean
> up instead of simply exiting.
> 
> Fixes: 3f9e31d71d63 ("test: clean up on exit")
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks
  

Patch

diff --git a/test/test/test.c b/test/test/test.c
index 24df6299e..12fabd0ba 100644
--- a/test/test/test.c
+++ b/test/test/test.c
@@ -102,8 +102,10 @@  main(int argc, char **argv)
 		/* merge argc/argv and the environment args */
 		all_argc = argc + eargc;
 		all_argv = malloc(sizeof(*all_argv) * (all_argc + 1));
-		if (all_argv == NULL)
-			return -1;
+		if (all_argv == NULL) {
+			ret = -1;
+			goto out;
+		}
 
 		for (i = 0; i < argc; i++)
 			all_argv[i] = argv[i];