jpegyuv: fix memory leak when @image_buffer allocation fails

Make sure @yuv_buffer is freed before return.
This commit is contained in:
Tristan Matthews
2015-05-03 21:35:39 -04:00
parent 6c1538470f
commit 7e8ed0d448

View File

@@ -112,6 +112,7 @@ int main(int argc, char *argv[]) {
image_buffer = malloc(frame_width*16 + 2*(frame_width/2)*8);
if (!image_buffer) {
free(yuv_buffer);
fprintf(stderr, "Memory allocation failure!\n");
return 1;
}