pg: fix memory leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2013-03-27 16:16:46 +01:00
parent c1253a3b10
commit 765056b372
1 changed files with 3 additions and 1 deletions

View File

@ -569,8 +569,10 @@ static int getcount(char *cmdstr)
} else } else
*(buf + strlen(buf) - 1) = '\0'; *(buf + strlen(buf) - 1) = '\0';
} }
if (*buf == '\0') if (*buf == '\0') {
free(buf);
return 1; return 1;
}
if (buf[0] == '-' && buf[1] == '\0') { if (buf[0] == '-' && buf[1] == '\0') {
i = -1; i = -1;
} else { } else {