commit 48ff6f55f459728134aa80de2dcaccce975d3036 from: Stefan Sperling via: Thomas Adam date: Thu Nov 03 22:16:57 2022 UTC fix free() of wrong address in gotweb's parse.y Found by sthen via ports-gcc: gotweb/parse.y:504:3: warning: attempt to free a non-heap object 'file' commit - db97f624e0d3f6f3e57fdb7961da1b61bb6baad1 commit + 48ff6f55f459728134aa80de2dcaccce975d3036 blob - 6676eb0a0649ddeb36686b874f1c193eb6fead0a blob + e1d44725734b9a6babef6ed3ea9430e0c42150dd --- gotweb/parse.y +++ gotweb/parse.y @@ -502,7 +502,7 @@ pushfile(struct file **nfile, const char *name) if (((*nfile) = calloc(1, sizeof(struct file))) == NULL) return got_error_from_errno2(__func__, "calloc"); if (((*nfile)->name = strdup(name)) == NULL) { - free(nfile); + free(*nfile); return got_error_from_errno2(__func__, "strdup"); } if (((*nfile)->stream = fopen((*nfile)->name, "re")) == NULL) {