commit ffe7e7c163f1ed8bff4c1a2309eb7e21c132d665 from: Stefan Sperling date: Thu Nov 03 13:51:10 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 - 7a52a8bcab46bbdee77445b05e844f903ff1fbcd commit + ffe7e7c163f1ed8bff4c1a2309eb7e21c132d665 blob - 9ae9b6d5b2c163cd71dd4d6c284eeb75e027fb1a blob + e96fe3c7b230722b5e7bd852896389d4d473c7d1 --- gotweb/parse.y +++ gotweb/parse.y @@ -501,7 +501,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) {