summaryrefslogtreecommitdiff
path: root/lib/neardal_record.c
diff options
context:
space:
mode:
authorArron Wang <arron.wang@intel.com>2014-11-25 16:30:53 +0800
committerArron Wang <arron.wang@intel.com>2014-11-25 16:30:53 +0800
commitd688ade2652950eb191eff2caaa74a818d3388dd (patch)
treeb8d3b040dfb3054724f71b2a4140f93c3d8c834a /lib/neardal_record.c
parentb2d951971361e93c8a6ed67d1bb5fda4fae21532 (diff)
downloadneardal-d688ade2652950eb191eff2caaa74a818d3388dd.tar.gz
neardal-d688ade2652950eb191eff2caaa74a818d3388dd.tar.bz2
neardal-d688ade2652950eb191eff2caaa74a818d3388dd.zip
Fix crash issue during record operation
Change-Id: I9c2ec79487b5cff46a937e2eda8960827d45bf6a
Diffstat (limited to 'lib/neardal_record.c')
-rw-r--r--lib/neardal_record.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/neardal_record.c b/lib/neardal_record.c
index fcffc1e..01ea506 100644
--- a/lib/neardal_record.c
+++ b/lib/neardal_record.c
@@ -31,7 +31,7 @@ void neardal_record_free(neardal_record *r)
{
g_return_if_fail(r);
neardal_g_strfreev((void **) r, &r->uriObjSize);
- memset(r, 0, sizeof(*r));
+ r = NULL;
}
void neardal_free_record(neardal_record *record) \
@@ -114,7 +114,10 @@ void neardal_record_add(GVariant *record)
neardal_g_variant_dump(record);
- neardalMgr.cb.rcd_found(neardal_g_variant_get(record, "Name", "&s"),
+
+ if (neardalMgr.cb.rcd_found != NULL)
+ neardalMgr.cb.rcd_found(
+ neardal_g_variant_get(record, "Name", "&s"),
neardalMgr.cb.rcd_found_ud);
}