From 405b2cea000c3c2e09d4f486aff444c6fca41e8a Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Mon, 8 Jan 2007 13:34:39 +0000 Subject: Don't leak strings. ok miod@ --- sbin/dhclient/parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sbin') diff --git a/sbin/dhclient/parse.c b/sbin/dhclient/parse.c index 9311f52a8b5..78ce155a102 100644 --- a/sbin/dhclient/parse.c +++ b/sbin/dhclient/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.17 2006/11/22 21:35:56 stevesk Exp $ */ +/* $OpenBSD: parse.c,v 1.18 2007/01/08 13:34:38 krw Exp $ */ /* Common parser code for dhcpd and dhclient. */ @@ -128,8 +128,10 @@ parse_string(FILE *cfile) error("no memory for string %s.", val); strlcpy(s, val, strlen(val) + 1); - if (!parse_semi(cfile)) + if (!parse_semi(cfile)) { + free(s); return (NULL); + } return (s); } -- cgit v1.2.3