Skip to content

Commit

Permalink
GH-19 Fix memory leak by p4LoadFile.
Browse files Browse the repository at this point in the history
  • Loading branch information
SirWumpus committed Sep 4, 2024
1 parent 844b4d9 commit 01ec503
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/post4.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,12 @@ p4LoadFile(P4_Ctx *ctx, const char *file)
if ((fp = fopen(filepath, "r")) != NULL) {
rc = p4EvalFp(ctx, fp);
(void) fclose(fp);
return rc;
break;
}
}
free(p4path);
error1:
if (ctx->frame == 0) {
if (rc != P4_THROW_OK && ctx->frame == 0) {
warn("%s", file);
}
error0:
Expand Down

0 comments on commit 01ec503

Please sign in to comment.