From a8c8e686c85e9a1aa0b1c9e5ad429909f85b268e Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 30 Apr 2014 09:50:00 +0000 Subject: [PATCH] Fix some possible leaks. --- dhcp-common.c | 1 + if-options.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/dhcp-common.c b/dhcp-common.c index 5b8d15f4..d877436a 100644 --- a/dhcp-common.c +++ b/dhcp-common.c @@ -80,6 +80,7 @@ dhcp_vendor(char *str, size_t len) p += l; len -= (size_t)l; l = if_machinearch(p, len); + p += l; return (size_t)(p - str); } diff --git a/if-options.c b/if-options.c index 087d2af0..90a28a29 100644 --- a/if-options.c +++ b/if-options.c @@ -1675,6 +1675,7 @@ err_sla: 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 @@ err_sla: s = parse_string(NULL, 0, arg); if (s == -1) { syslog(LOG_ERR, "realm_len: %m"); + free(token); return -1; } if (s) { -- 2.47.3