commit f5feadcc2d9dc4fb3f64ed21683f11df58eb73d7 from: Stefan Sperling date: Mon Jun 04 14:22:01 2018 UTC fix bogus free() in error path of cache_pack() commit - 9c2eaf349f94739d711574b409e7a16a5029c4f4 commit + f5feadcc2d9dc4fb3f64ed21683f11df58eb73d7 blob - 6ced42c00804dbc2dce4ae8c33debdd3c8a80563 blob + ce51140a9103308797ff08128ff48a30ef3a4334 --- lib/pack.c +++ lib/pack.c @@ -593,9 +593,10 @@ cache_pack(struct got_pack **packp, const char *path_p err = get_packfile_size(&pack->filesize, path_packfile); done: if (err) { - if (pack) + if (pack) { free(pack->path_packfile); - free(pack); + memset(pack, 0, sizeof(*pack)); + } } else if (packp) *packp = pack; return err;