commit 661e70e391f3226a03b385a04081b04bf462c661 from: Stefan Sperling via: Thomas Adam date: Fri Jan 03 10:46:48 2025 UTC plug imsgbuf-related memory leak in got_repo_load() commit - 4ea1597e9427b3edc4b5fc4a3c432fea5c2ef590 commit + 661e70e391f3226a03b385a04081b04bf462c661 blob - ebbcf53897e1e06aed566a1522ae973f490bbee2 blob + 91c776baa99b16666bc294f23fb1dc126f4eb85f --- lib/load.c +++ lib/load.c @@ -231,6 +231,8 @@ got_repo_load(FILE *in, struct got_pathlist_head *refs int ch, done, nobj, idxstatus; pid_t idxpid; enum got_hash_algorithm repo_algo, bundle_algo; + + memset(&idxibuf, 0, sizeof(idxibuf)); got_ratelimit_init(&rl, 0, 500); repo_algo = got_repo_get_object_format(repo); @@ -560,6 +562,8 @@ got_repo_load(FILE *in, struct got_pathlist_head *refs tmpidxpath = NULL; done: + if (idxibuf.w) + imsgbuf_clear(&idxibuf); free(line); free(packpath); free(idxpath);