[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[redhat-lspp] device allocator patch: resource leak
- From: Debora Velarde <dvelarde us ibm com>
- To: chanson TrustedCS com, colmo TrustedCS com
- Cc: redhat-lspp redhat com
- Subject: [redhat-lspp] device allocator patch: resource leak
- Date: Tue, 27 Jun 2006 18:08:45 -0700
Below is a patch for a resource leak found by Coverity.
If the calloc call succeeds for 'new' //line 692
and
new->class_name = strdup(token) returns NULL //line 699
and
class_list = NULL //line 733
Then funtion returns without freeing new
--- dev_allocator/lib/parse.c.orig 2006-06-27 10:47:07.000000000
-0500
+++ dev_allocator/lib/parse.c 2006-06-27 10:41:37.000000000 -0500
@@ -728,6 +728,8 @@
error_out:
if (conf_file)
fclose(conf_file);
+ if (new)
+ free(new);
while (class_list != NULL) {
new = class_list;
class_list = class_list->next;
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]