From 765056b37265da3bc367899f54f833210a2cc2df Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 27 Mar 2013 16:16:46 +0100 Subject: pg: fix memory leak [coverity scan] Signed-off-by: Karel Zak --- text-utils/pg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'text-utils/pg.c') diff --git a/text-utils/pg.c b/text-utils/pg.c index ab7a85a95..c00b7371f 100644 --- a/text-utils/pg.c +++ b/text-utils/pg.c @@ -569,8 +569,10 @@ static int getcount(char *cmdstr) } else *(buf + strlen(buf) - 1) = '\0'; } - if (*buf == '\0') + if (*buf == '\0') { + free(buf); return 1; + } if (buf[0] == '-' && buf[1] == '\0') { i = -1; } else { -- cgit v1.2.3-55-g7522