Skip to content

Commit

Permalink
Merge pull request #173 from tmatth/jpegyuv_leak
Browse files Browse the repository at this point in the history
jpegyuv: fix memory leak when path is invalid
  • Loading branch information
kornelski committed May 5, 2015
2 parents 50d4088 + ee39375 commit 0d2908a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions jpegyuv.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ int main(int argc, char *argv[]) {
yuv_fd = fopen(yuv_path, "wb");
if (!yuv_fd) {
fprintf(stderr, "Invalid path to YUV file!");
free(yuv_buffer);
return 1;
}
if (fwrite(yuv_buffer, yuv_size, 1, yuv_fd) != 1) {
Expand Down

0 comments on commit 0d2908a

Please sign in to comment.