It is important to match g_*() memory allocation with g_free() --- As per the glib documentation, the memory allocated using the glib api's needs to be freed using corresponding glib free api's and not libc api's, otherwise undefined behaviour can happen. This is because the libc allocation and glib allocation uses different memory pools. src/storage.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/storage.c b/src/storage.c index 973d545..a91ee2d 100644 --- a/src/storage.c +++ b/src/storage.c @@ -732,7 +732,7 @@ int write_trust(const char *src, const char *addr, const char *service, else { char *new_str = service_list_to_string(services); ret = textfile_caseput(filename, addr, new_str); - free(new_str); + g_free(new_str); } g_slist_free(services); @@ -817,7 +817,7 @@ int store_record(const gchar *src, const gchar *dst, sdp_record_t *rec) err = textfile_put(filename, key, str); free(buf.data); - free(str); + g_free(str); return err; } @@ -839,7 +839,7 @@ sdp_record_t *record_from_string(const gchar *str) } rec = sdp_extract_pdu(pdata, size, &len); - free(pdata); + g_free(pdata); return rec; } -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html