jpegyuv: fix memory leak when path is invalid

This commit is contained in:
Tristan Matthews
2015-05-04 09:44:11 -04:00
parent 50d4088439
commit ee39375c85

View File

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