gdhcp: Use glib memory functions
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Wed, 19 Dec 2012 14:29:16 +0000 (15:29 +0100)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 20 Dec 2012 13:07:04 +0000 (15:07 +0200)
Use for all memory allocation/dealocation operation the glib
functions. This allows us to use g_mem_profile().

gdhcp/client.c

index 13ca442..e8fa5d5 100644 (file)
@@ -1510,7 +1510,7 @@ static char *malloc_option_value_string(uint8_t *option, GDHCPOptionType type)
                return NULL;
        upper_length = len_of_option_as_string[type] *
                        ((unsigned)len / (unsigned)optlen);
-       dest = ret = malloc(upper_length + 1);
+       dest = ret = g_malloc(upper_length + 1);
        if (ret == NULL)
                return NULL;