[PATCH ipset 4/4] Fix leak in build_argv() on line parsing error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Stefano Brivio <sbrivio@xxxxxxxxxx>
---
 src/ipset.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/ipset.c b/src/ipset.c
index ce1b73f51633..14a351a125f2 100644
--- a/src/ipset.c
+++ b/src/ipset.c
@@ -176,7 +176,7 @@ build_argv(char *buffer)
 		if ((newargc + 1) == (int)(sizeof(newargv)/sizeof(char *))) {
 			exit_error(PARAMETER_PROBLEM,
 				   "Line is too long to parse.");
-			return;
+			goto out;
 		}
 		switch (*tmp) {
 		case '"':
@@ -200,7 +200,7 @@ build_argv(char *buffer)
 		}
 		if (!*(tmp+1) && quoted) {
 			exit_error(PARAMETER_PROBLEM, "Missing close quote!");
-			return;
+			goto out;
 		}
 		if (!*arg)
 			continue;
@@ -209,6 +209,7 @@ build_argv(char *buffer)
 		memset(arg, 0, strlen(arg) + 1);
 		i = 0;
 	}
+out:
 	free(arg);
 }
 
-- 
2.18.0




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux