commit dca8ae22387b6cdd3bcb67c1ad961e6a093ffe1314c6b050b1741e4e32431b56 from: Stefan Sperling date: Sat Dec 28 13:43:07 2024 UTC plug imsgbuf-related memory leak in got_repo_load() commit - 5b331784568bdf77ca345a7eaba3c88855a0e34e4996169d1fdb42e47b284eeb commit + dca8ae22387b6cdd3bcb67c1ad961e6a093ffe1314c6b050b1741e4e32431b56 blob - a8af96e663e9aafbc6024e66a7205bacecedef0b155ae203b515e48173a50d9b blob + 084a7b6ee6580d07b44ddab1063df5363acd380e1c469658d5b996e89fafaff6 --- lib/load.c +++ lib/load.c @@ -234,6 +234,8 @@ got_repo_load(FILE *in, struct got_pathlist_head *refs 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); digest_len = got_hash_digest_length(repo_algo); @@ -562,6 +564,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);