← Back to team overview

hipl-core team mailing list archive

[Branch ~hipl-core/hipl/trunk] Rev 4926: Avoid possible NULL dereference.

 

------------------------------------------------------------
revno: 4926
committer: Christof Mroz <christof.mroz@xxxxxxxxxxxxxx>
branch nick: trunk
timestamp: Mon 2010-09-06 13:51:23 +0200
message:
  Avoid possible NULL dereference.
modified:
  firewall/conntrack.c


--
lp:hipl
https://code.launchpad.net/~hipl-core/hipl/trunk

Your team HIPL core team is subscribed to branch lp:hipl.
To unsubscribe from this branch go to https://code.launchpad.net/~hipl-core/hipl/trunk/+edit-subscription
=== modified file 'firewall/conntrack.c'
--- firewall/conntrack.c	2010-08-20 16:38:55 +0000
+++ firewall/conntrack.c	2010-09-06 11:51:23 +0000
@@ -580,16 +580,16 @@
 
         tuple->connection = NULL;
         // tuple was not malloced -> no free here
-    }
-
-    if (tuple->src_ip) {
-        free(tuple->src_ip);
-        tuple->src_ip = NULL;
-    }
-
-    if (tuple->dst_ip) {
-        free(tuple->dst_ip);
-        tuple->dst_ip = NULL;
+
+        if (tuple->src_ip) {
+            free(tuple->src_ip);
+            tuple->src_ip = NULL;
+        }
+
+        if (tuple->dst_ip) {
+            free(tuple->dst_ip);
+            tuple->dst_ip = NULL;
+        }
     }
 }