Skip to content

Commit e46fe1a

Browse files
committed
index-pack: work around false positive use of uninitialized variable
The base_name variable in this function is given a value if cmd.args array is not empty (i.e., if we run the pack-objects command), and the function returns when cmd.args is empty before hitting a call to free(base_name) near the end of the function, so to a human reader, it can be seen that the variable is not used uninitialized, but to a semi-intelligent compiler it is not so clear. Squelch a false positive by a meaningless NULL initialization. Signed-off-by: Junio C Hamano <[email protected]>
1 parent f5f2f41 commit e46fe1a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/index-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ static void repack_local_links(void)
18031803
struct strbuf line = STRBUF_INIT;
18041804
struct oidset_iter iter;
18051805
struct object_id *oid;
1806-
char *base_name;
1806+
char *base_name = NULL;
18071807

18081808
if (!oidset_size(&outgoing_links))
18091809
return;

0 commit comments

Comments
 (0)