]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ps/leakfixes' into jk/leakfixes
authorJunio C Hamano <gitster@pobox.com>
Thu, 30 May 2024 15:54:58 +0000 (08:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 May 2024 15:54:58 +0000 (08:54 -0700)
* ps/leakfixes:
  builtin/mv: fix leaks for submodule gitfile paths
  builtin/mv: refactor to use `struct strvec`
  builtin/mv duplicate string list memory
  builtin/mv: refactor `add_slash()` to always return allocated strings
  strvec: add functions to replace and remove strings
  submodule: fix leaking memory for submodule entries
  commit-reach: fix memory leak in `ahead_behind()`
  builtin/credential: clear credential before exit
  config: plug various memory leaks
  config: clarify memory ownership in `git_config_string()`
  builtin/log: stop using globals for format config
  builtin/log: stop using globals for log config
  convert: refactor code to clarify ownership of check_roundtrip_encoding
  diff: refactor code to clarify memory ownership of prefixes
  config: clarify memory ownership in `git_config_pathname()`
  http: refactor code to clarify memory ownership
  checkout: clarify memory ownership in `unique_tracking_name()`
  strbuf: fix leak when `appendwholeline()` fails with EOF
  transport-helper: fix leaking helper name

1  2 
Makefile
builtin/config.c
builtin/log.c
config.c
config.h
fetch-pack.c
sequencer.c

diff --cc Makefile
index 8f4432ae57cdd0414720ea51779be89affe28cee,d4000fb1d69bcc47dbe1a2f820860ec138f03324..dec283578aa9406f2d17ed77432c8d10af4afc3e
+++ b/Makefile
@@@ -1334,11 -1334,11 +1334,12 @@@ THIRD_PARTY_SOURCES += compat/regex/
  THIRD_PARTY_SOURCES += sha1collisiondetection/%
  THIRD_PARTY_SOURCES += sha1dc/%
  
 +UNIT_TEST_PROGRAMS += t-ctype
  UNIT_TEST_PROGRAMS += t-mem-pool
 +UNIT_TEST_PROGRAMS += t-prio-queue
  UNIT_TEST_PROGRAMS += t-strbuf
 -UNIT_TEST_PROGRAMS += t-ctype
 -UNIT_TEST_PROGRAMS += t-prio-queue
+ UNIT_TEST_PROGRAMS += t-strvec
 +UNIT_TEST_PROGRAMS += t-trailer
  UNIT_TEST_PROGS = $(patsubst %,$(UNIT_TEST_BIN)/%$X,$(UNIT_TEST_PROGRAMS))
  UNIT_TEST_OBJS = $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(UNIT_TEST_PROGRAMS))
  UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o
index c38264c999a2e6468027fa40627564500e54d494,cc343f55cac8e8bed5e78fede64036b342c44aa7..20a0b64090eab56d3b6a54073e338fdbf5db4448
@@@ -288,8 -276,8 +288,8 @@@ static int format_config(const struct c
                                strbuf_addstr(buf, value_);
                        else
                                strbuf_addstr(buf, v ? "true" : "false");
 -              } else if (type == TYPE_PATH) {
 +              } else if (opts->type == TYPE_PATH) {
-                       const char *v;
+                       char *v;
                        if (git_config_pathname(&v, key_, value_) < 0)
                                return -1;
                        strbuf_addstr(buf, v);
diff --cc builtin/log.c
Simple merge
diff --cc config.c
Simple merge
diff --cc config.h
Simple merge
diff --cc fetch-pack.c
Simple merge
diff --cc sequencer.c
Simple merge