shithub: dumb

Download patch

ref: 59afe93d2fa404fab08322c0b93aeda3d02d1494
parent: 46e7e4f5b93927f2f6306c8d1589f118f964787a
author: Chris Spiegel <[email protected]>
date: Mon Aug 10 17:07:17 EDT 2015

Fix memory leaks.

--- a/dumb/src/it/readptm.c
+++ b/dumb/src/it/readptm.c
@@ -439,6 +439,7 @@
 	}
 
     if (dumbfile_seek(f, 352, DFS_SEEK_SET)) {
+		free(component);
 		_dumb_it_unload_sigdata(sigdata);
 		return NULL;
 	}
@@ -451,6 +452,7 @@
 	}
 
     if (dumbfile_seek(f, 608, DFS_SEEK_SET)) {
+		free(component);
 		_dumb_it_unload_sigdata(sigdata);
 		return NULL;
 	}
@@ -457,6 +459,7 @@
 
 	for (n = 0; n < sigdata->n_samples; n++) {
 		if (it_ptm_read_sample_header(&sigdata->sample[n], &component[n_components].offset, f)) {
+			free(component);
 			_dumb_it_unload_sigdata(sigdata);
 			return NULL;
 		}