plug a few coverity-spotted leaks
Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
28eb1afec9
commit
dc4cd76710
@ -811,19 +811,21 @@ static void parse_push(struct strbuf *buf)
|
||||
|
||||
strbuf_reset(buf);
|
||||
if (strbuf_getline(buf, stdin, '\n') == EOF)
|
||||
return;
|
||||
goto free_specs;
|
||||
if (!*buf->buf)
|
||||
break;
|
||||
} while (1);
|
||||
|
||||
if (push(nr_spec, specs))
|
||||
exit(128); /* error already reported */
|
||||
for (i = 0; i < nr_spec; i++)
|
||||
free(specs[i]);
|
||||
free(specs);
|
||||
|
||||
printf("\n");
|
||||
fflush(stdout);
|
||||
|
||||
free_specs:
|
||||
for (i = 0; i < nr_spec; i++)
|
||||
free(specs[i]);
|
||||
free(specs);
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
|
Reference in New Issue
Block a user