changeset 2451:728116e38471 draft

Fix some possible leaks.
author Roy Marples <roy@marples.name>
date Wed, 30 Apr 2014 09:50:00 +0000
parents d64ad6b8a38a
children 191d774c7b20
files dhcp-common.c if-options.c
diffstat 2 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dhcp-common.c	Wed Apr 30 09:35:48 2014 +0000
+++ b/dhcp-common.c	Wed Apr 30 09:50:00 2014 +0000
@@ -80,6 +80,7 @@
 	p += l;
 	len -= (size_t)l;
 	l = if_machinearch(p, len);
+	p += l;
 	return (size_t)(p - str);
 }
 
--- a/if-options.c	Wed Apr 30 09:35:48 2014 +0000
+++ b/if-options.c	Wed Apr 30 09:50:00 2014 +0000
@@ -1675,6 +1675,7 @@
 		token = malloc(sizeof(*token));
 		if (token == NULL) {
 			syslog(LOG_ERR, "%s: %m", __func__);
+			free(token);
 			return -1;
 		}
 		if (parse_uint32(&token->secretid, arg) == -1) {
@@ -1693,6 +1694,7 @@
 		s = parse_string(NULL, 0, arg);
 		if (s == -1) {
 			syslog(LOG_ERR, "realm_len: %m");
+			free(token);
 			return -1;
 		}
 		if (s) {