summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>2014-09-15 14:23:26 +0300
committerFrederic PAUT <fpaut@fpaut-MOBL2>2014-11-03 11:52:23 +0100
commitd5a2a6f2d61b2edf850256a75cb03144ff83b4d6 (patch)
tree2d4deef4029c33eade25ee6a524a1fa5932db1e3
parenta5709864b534732d22ad2cf443623140fe95fbfe (diff)
downloadneardal-d5a2a6f2d61b2edf850256a75cb03144ff83b4d6.tar.gz
neardal-d5a2a6f2d61b2edf850256a75cb03144ff83b4d6.tar.bz2
neardal-d5a2a6f2d61b2edf850256a75cb03144ff83b4d6.zip
Use neardal_g_strfreev().
This also fixes memory leaks.
-rw-r--r--lib/neardal_record.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/neardal_record.c b/lib/neardal_record.c
index 273a455..5e222dc 100644
--- a/lib/neardal_record.c
+++ b/lib/neardal_record.c
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <glib.h>
@@ -28,9 +29,9 @@
void neardal_record_free(neardal_record *r)
{
- /* let's use uri as sentinel for g_strfreev() */
- g_clear_pointer(&r->uri, g_free);
- g_strfreev((char **) r);
+ g_return_if_fail(r);
+ neardal_g_strfreev((void **) r, &r->uriObjSize);
+ memset(r, 0, sizeof(*r));
}
GVariant *neardal_record_to_g_variant(neardal_record *in)