[hipl-commit] [trunk] Rev 3539: Reverted defective memory leak fix in lib/core/linkedlist.c (revno 3531). There was no memory leak!

  • From: Tim Just <tim.just@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Fri, 5 Feb 2010 11:57:23 +0200

Committer: Tim Just <tim.just@xxxxxxxxxxxxxx>
Date: Fri Feb 05 10:56:22 2010 +0100
Revision: 3539
Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  Reverted defective memory leak fix in lib/core/linkedlist.c (revno 3531). 
There was no memory leak!

Modified:
  M  lib/core/linkedlist.c

=== modified file 'lib/core/linkedlist.c'
--- lib/core/linkedlist.c       2010-02-04 17:13:59 +0000
+++ lib/core/linkedlist.c       2010-02-05 09:56:22 +0000
@@ -64,8 +64,7 @@
        
        if ((newnode =
             (hip_ll_node_t*) malloc(sizeof(hip_ll_node_t))) == NULL) {
-               HIP_ERROR("Error on allocating memory for a linked list "\
-                         "node.\n");
+               HIP_ERROR("Error on allocating memory for a linked list 
node.\n");
                return -1;
        }
 
@@ -98,7 +97,7 @@
                                newnode->next = pointer;
                                previous->next = newnode;
                                linkedlist->element_count++;
-                               goto out;
+                               return 0;
                        }
                }
                /* The node is to be added as the last item of the list. */
@@ -107,10 +106,6 @@
                linkedlist->element_count++;
        }
 
- out:
-       if (newnode) {
-           HIP_FREE(newnode);
-       }
        return 0;
 }

Other related posts:

  • » [hipl-commit] [trunk] Rev 3539: Reverted defective memory leak fix in lib/core/linkedlist.c (revno 3531). There was no memory leak! - Tim Just