diff options
author | Arron Wang <arron.wang@intel.com> | 2014-11-25 16:30:53 +0800 |
---|---|---|
committer | Arron Wang <arron.wang@intel.com> | 2014-11-25 16:30:53 +0800 |
commit | d688ade2652950eb191eff2caaa74a818d3388dd (patch) | |
tree | b8d3b040dfb3054724f71b2a4140f93c3d8c834a /lib | |
parent | b2d951971361e93c8a6ed67d1bb5fda4fae21532 (diff) | |
download | neardal-d688ade2652950eb191eff2caaa74a818d3388dd.tar.gz neardal-d688ade2652950eb191eff2caaa74a818d3388dd.tar.bz2 neardal-d688ade2652950eb191eff2caaa74a818d3388dd.zip |
Fix crash issue during record operation
Change-Id: I9c2ec79487b5cff46a937e2eda8960827d45bf6a
Diffstat (limited to 'lib')
-rw-r--r-- | lib/neardal_record.c | 7 |
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); } |