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;


--
redhat-lspp mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/redhat-lspp

Reply via email to