Quellcode durchsuchen

Fix memory leak

Benjamin Schaaf vor 4 Jahren
Ursprung
Commit
af641f2a63
2 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 1 0
      process_pipeline.c
  2. 1 0
      zbar_pipeline.c

+ 1 - 0
process_pipeline.c

@@ -424,6 +424,7 @@ mp_process_pipeline_process_image(MPImage image)
 	// If we haven't processed the previous frame yet, drop this one
 	if (frames_received != frames_processed && !is_capturing) {
 		printf("Dropped frame at capture\n");
+		free(image.data);
 		return;
 	}
 

+ 1 - 0
zbar_pipeline.c

@@ -160,6 +160,7 @@ mp_zbar_pipeline_process_image(cairo_surface_t *surface)
 {
 	// If we haven't processed the previous frame yet, drop this one
 	if (frames_received != frames_processed) {
+		cairo_surface_destroy(surface);
 		return;
 	}