olsr_switch: fix a memory leak
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 12:14:44 +0000 (14:14 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 12:49:41 +0000 (14:49 +0200)
Coverity:
CID 739687 (#1 of 1): Resource leak (RESOURCE_LEAK)
At (16): Variable "oc" going out of scope leaks the storage it points to.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/olsr_switch/main.c

index a8dd412..893a9cd 100644 (file)
@@ -163,6 +163,7 @@ ohs_init_new_connection(int s)
 
   if (i == 20) {
     printf("Failed to fetch IP address! (%s)\n", strerror(errno));
+    free(oc);
     return -1;
   }