diff mbox series

[v2] refs/files: prevent memory leak by freeing packed_ref_store

Message ID pull.1757.v2.git.git.1722851612505.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit e2e373ba82d2cb19b60e91318626bda78eba7872
Headers show
Series [v2] refs/files: prevent memory leak by freeing packed_ref_store | expand

Commit Message

Sven Strickroth Aug. 5, 2024, 9:53 a.m. UTC
From: Sven Strickroth <email@cs-ware.de>

This complements 64a6dd8ffc (refs: implement removal of ref storages,
2024-06-06).

Signed-off-by: Sven Strickroth <email@cs-ware.de>
---
    refs/files: prevent memory leak by freeing packed_ref_store
    
    This complements "refs: implement removal of ref storages"
    (64a6dd8ffc2f).

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1757%2Fcsware%2Frefs-files-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1757/csware/refs-files-v2
Pull-Request: https://github.com/git/git/pull/1757

Range-diff vs v1:

 1:  c68d0de3d58 ! 1:  96018e7257c refs/files: prevent memory leak by freeing packed_ref_store
     @@ Metadata
       ## Commit message ##
          refs/files: prevent memory leak by freeing packed_ref_store
      
     -    This complements "refs: implement removal of ref storages" (64a6dd8ffc2f).
     +    This complements 64a6dd8ffc (refs: implement removal of ref storages,
     +    2024-06-06).
      
          Signed-off-by: Sven Strickroth <email@cs-ware.de>
      


 refs/files-backend.c | 1 +
 1 file changed, 1 insertion(+)


base-commit: e559c4bf1a306cf5814418d318cc0fea070da3c7

Comments

Patrick Steinhardt Aug. 5, 2024, 11:17 a.m. UTC | #1
On Mon, Aug 05, 2024 at 09:53:32AM +0000, Sven Strickroth via GitGitGadget wrote:
> From: Sven Strickroth <email@cs-ware.de>
> 
> This complements 64a6dd8ffc (refs: implement removal of ref storages,
> 2024-06-06).
> 
> Signed-off-by: Sven Strickroth <email@cs-ware.de>

Thanks, this version looks good to me!

Patrick
Junio C Hamano Aug. 5, 2024, 3:58 p.m. UTC | #2
Patrick Steinhardt <ps@pks.im> writes:

> On Mon, Aug 05, 2024 at 09:53:32AM +0000, Sven Strickroth via GitGitGadget wrote:
>> From: Sven Strickroth <email@cs-ware.de>
>> 
>> This complements 64a6dd8ffc (refs: implement removal of ref storages,
>> 2024-06-06).
>> 
>> Signed-off-by: Sven Strickroth <email@cs-ware.de>
>
> Thanks, this version looks good to me!

Thanks, both.
diff mbox series

Patch

diff --git a/refs/files-backend.c b/refs/files-backend.c
index aa52d9be7c7..11551de8f84 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -157,6 +157,7 @@  static void files_ref_store_release(struct ref_store *ref_store)
 	free_ref_cache(refs->loose);
 	free(refs->gitcommondir);
 	ref_store_release(refs->packed_ref_store);
+	free(refs->packed_ref_store);
 }
 
 static void files_reflog_path(struct files_ref_store *refs,