comparison 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
comparison
equal deleted inserted replaced
407:1c7ed7097a9c 408:3da217bd0e48
109 if (plp == NULL) 109 if (plp == NULL)
110 return; 110 return;
111 111
112 plp->path = safe_malloc(strlen(s) + 1); 112 plp->path = safe_malloc(strlen(s) + 1);
113 if (plp->path == NULL) 113 if (plp->path == NULL)
114 {
115 free(plp);
114 return; 116 return;
115 117 }
118
116 strcpy(plp->path, s); 119 strcpy(plp->path, s);
117 plp->next = pathlist; 120 plp->next = pathlist;
118 pathlist = plp; 121 pathlist = plp;
119 } 122 }
120 123
124 PathList *next; 127 PathList *next;
125 128
126 while (plp) 129 while (plp)
127 { 130 {
128 next = plp->next; 131 next = plp->next;
132 free(plp->path);
129 free(plp); 133 free(plp);
130 plp = next; 134 plp = next;
131 } 135 }
132 } 136 }