Revert "prevent doubly freeing memory on invalid packet"
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 8 Dec 2009 00:52:20 +0000 (11:52 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 8 Dec 2009 00:52:20 +0000 (11:52 +1100)
This reverts commit 1975b53b5ea608d60b8b3e527a435a7c817a97ea.

tcp/tcp_io.c

index 257446c8fc07ff8334846f3fe3682e54249a8b37..10711d1ea188422e8609a7d88cc13dd62c787be8 100644 (file)
@@ -75,15 +75,7 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args)
        return;
 
 failed:
-       /*
-        * removed the talloc_free(in) in order to prevent a double free on 'in'
-        * Questions: 
-        *  - Are we introducing a memory leak? I don't think so.
-        *  - Is there a destructor missing that removes this block from the queue
-        *    it was already added? Yes, I think this is missing.
-        *  - Why do we get such invalid packages? Hmm....
-        */
-       return;
+       talloc_free(in);
 }
 
 /*