diff options
author | Karel Zak | 2013-03-27 16:16:46 +0100 |
---|---|---|
committer | Karel Zak | 2013-03-27 16:16:46 +0100 |
commit | 765056b37265da3bc367899f54f833210a2cc2df (patch) | |
tree | 176b6ec1ab63d31307d8d49b6111dda0d4bbf916 /text-utils | |
parent | libfdisk: (gpt) fix memory leak [coverity scan] (diff) | |
download | kernel-qcow2-util-linux-765056b37265da3bc367899f54f833210a2cc2df.tar.gz kernel-qcow2-util-linux-765056b37265da3bc367899f54f833210a2cc2df.tar.xz kernel-qcow2-util-linux-765056b37265da3bc367899f54f833210a2cc2df.zip |
pg: fix memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'text-utils')
-rw-r--r-- | text-utils/pg.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 { |