Skip to content

Commit 50b6773

Browse files
stefanbellergitster
authored andcommitted
clone.c: don't leak memory in cmd_clone
Free the refspec. Found by scan.coverity.com (Id: 1127806) Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2f50bab commit 50b6773

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/clone.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,5 +1000,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
10001000
strbuf_release(&key);
10011001
strbuf_release(&value);
10021002
junk_mode = JUNK_LEAVE_ALL;
1003+
1004+
free(refspec);
10031005
return err;
10041006
}

0 commit comments

Comments
 (0)