Skip to content

Commit

Permalink
clone.c: don't leak memory in cmd_clone
Browse files Browse the repository at this point in the history
Free the refspec.
Found by scan.coverity.com (Id: 1127806)

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Stefan Beller authored and Junio C Hamano committed Aug 10, 2014
1 parent 2f50bab commit 50b6773
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builtin/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,5 +1000,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
strbuf_release(&key);
strbuf_release(&value);
junk_mode = JUNK_LEAVE_ALL;

free(refspec);
return err;
}

0 comments on commit 50b6773

Please sign in to comment.