Commit Diff


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