diff decoders/timidity/common.c @ 408:3da217bd0e48

Memory leak fixes.
author Ryan C. Gordon <icculus@icculus.org>
date Mon, 29 Jul 2002 07:50:29 +0000
parents 2d887640d300
children 9c12dc86d482
line wrap: on
line diff
--- a/decoders/timidity/common.c	Sun Jul 21 15:18:49 2002 +0000
+++ b/decoders/timidity/common.c	Mon Jul 29 07:50:29 2002 +0000
@@ -111,8 +111,11 @@
 
   plp->path = safe_malloc(strlen(s) + 1);
   if (plp->path == NULL)
+  {
+      free(plp);
       return;
-  
+  }
+
   strcpy(plp->path, s);
   plp->next = pathlist;
   pathlist = plp;
@@ -126,6 +129,7 @@
     while (plp)
     {
 	next = plp->next;
+	free(plp->path);
 	free(plp);
 	plp = next;
     }