Skip to content

Commit 948e4b3

Browse files
committed
pack-redundant: avoid accessing uninitialized variables
The `l` variable holds a list of packs, but its `next` attribute seems not to be initialized before inserting into the list. Let's ensure that `l` is initialized properly. Pointed out by Coverity. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent d6b90c7 commit 948e4b3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

builtin/pack-redundant.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ static void scan_alt_odb_packs(void)
536536

537537
static struct pack_list * add_pack(struct packed_git *p)
538538
{
539-
struct pack_list l;
539+
struct pack_list l = { NULL };
540540
size_t off = 0, step;
541541
const unsigned char *base;
542542

0 commit comments

Comments
 (0)