]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ps/leakfixes-part-4'
authorJunio C Hamano <gitster@pobox.com>
Fri, 23 Aug 2024 16:02:33 +0000 (09:02 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 Aug 2024 16:02:33 +0000 (09:02 -0700)
More leak fixes.

* ps/leakfixes-part-4: (22 commits)
  builtin/diff: free symmetric diff members
  diff: free state populated via options
  builtin/log: fix leak when showing converted blob contents
  userdiff: fix leaking memory for configured diff drivers
  builtin/format-patch: fix various trivial memory leaks
  diff: fix leak when parsing invalid ignore regex option
  unpack-trees: clear index when not propagating it
  sequencer: release todo list on error paths
  merge-ort: unconditionally release attributes index
  builtin/fast-export: plug leaking tag names
  builtin/fast-export: fix leaking diff options
  builtin/fast-import: plug trivial memory leaks
  builtin/notes: fix leaking `struct notes_tree` when merging notes
  builtin/rebase: fix leaking `commit.gpgsign` value
  config: fix leaking comment character config
  submodule-config: fix leaking name entry when traversing submodules
  read-cache: fix leaking hashfile when writing index fails
  bulk-checkin: fix leaking state TODO
  object-name: fix leaking symlink paths in object context
  object-file: fix memory leak when reading corrupted headers
  ...

1  2 
builtin/notes.c
config.c
csum-file.c
csum-file.h
object-file.c
object-name.c
remote.c
t/t4069-remerge-diff.sh
t/t6421-merge-partial-clone.sh

diff --cc builtin/notes.c
Simple merge
diff --cc config.c
Simple merge
diff --cc csum-file.c
Simple merge
diff --cc csum-file.h
index 36c7c5585f5672d4af089aee760c0240653b0942,ca553eba173cd1c004329d4600716b7768c8379e..7c73da0a40a9f342be766db4360eb2a236817c2b
@@@ -46,8 -46,17 +46,18 @@@ int hashfile_truncate(struct hashfile *
  struct hashfile *hashfd(int fd, const char *name);
  struct hashfile *hashfd_check(const char *name);
  struct hashfile *hashfd_throughput(int fd, const char *name, struct progress *tp);
+ /*
+  * Free the hashfile without flushing its contents to disk. This only
+  * needs to be called when not calling `finalize_hashfile()`.
+  */
+ void free_hashfile(struct hashfile *f);
+ /*
+  * Finalize the hashfile by flushing data to disk and free'ing it.
+  */
  int finalize_hashfile(struct hashfile *, unsigned char *, enum fsync_component, unsigned int);
 +void discard_hashfile(struct hashfile *);
  void hashwrite(struct hashfile *, const void *, unsigned int);
  void hashflush(struct hashfile *f);
  void crc32_begin(struct hashfile *);
diff --cc object-file.c
Simple merge
diff --cc object-name.c
Simple merge
diff --cc remote.c
Simple merge
Simple merge
Simple merge