Commit Diff


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) {