vpn: Free ip address before allocating a new one
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Sun, 7 Apr 2013 14:54:23 +0000 (17:54 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Mon, 8 Apr 2013 06:16:45 +0000 (09:16 +0300)
Possible memory leak here as we might have ip address allocated
already.

plugins/vpn.c

index 7a768c8..a0c6928 100644 (file)
@@ -395,6 +395,7 @@ static int extract_ip(DBusMessageIter *array, int family,
                dbus_message_iter_next(&dict);
        }
 
+       connman_ipaddress_free(data->ip);
        data->ip = connman_ipaddress_alloc(family);
        if (data->ip == NULL)
                return -ENOMEM;