File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -644,10 +644,7 @@ static void index_walking(git_repository *repo)
644644static void reference_listing (git_repository * repo )
645645{
646646 git_strarray ref_list ;
647- const char * refname ;
648- git_reference * ref ;
649647 unsigned i ;
650- char oid_hex [GIT_OID_HEXSZ + 1 ];
651648
652649 printf ("\n*Reference Listing*\n" );
653650
@@ -662,7 +659,10 @@ static void reference_listing(git_repository *repo)
662659 git_reference_list (& ref_list , repo );
663660
664661 for (i = 0 ; i < ref_list .count ; ++ i ) {
665- memset (oid_hex , 0 , sizeof (oid_hex ));
662+ git_reference * ref ;
663+ char oid_hex [GIT_OID_HEXSZ + 1 ] = GIT_OID_HEX_ZERO ;
664+ const char * refname ;
665+
666666 refname = ref_list .strings [i ];
667667 git_reference_lookup (& ref , repo , refname );
668668
@@ -679,6 +679,8 @@ static void reference_listing(git_repository *repo)
679679 fprintf (stderr , "Unexpected reference type\n" );
680680 exit (1 );
681681 }
682+
683+ git_reference_free (ref );
682684 }
683685
684686 git_strarray_free (& ref_list );
You can’t perform that action at this time.
0 commit comments