projects
/
platform
/
upstream
/
neard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5fea280
)
ndef: fix small bug on memory release
author
Olivier Guiter
<olivier.guiter@linux.intel.com>
Thu, 1 Dec 2011 12:30:41 +0000
(13:30 +0100)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Fri, 2 Dec 2011 14:45:56 +0000
(15:45 +0100)
src/ndef.c
patch
|
blob
|
history
diff --git
a/src/ndef.c
b/src/ndef.c
index
e6f6116
..
e344591
100644
(file)
--- a/
src/ndef.c
+++ b/
src/ndef.c
@@
-1124,17
+1124,18
@@
int near_ndef_parse(struct near_tag *tag,
r_type = get_record_type(t_tnf, type, type_length);
offset += (type_length + il_length);
- g_free(type);
record = g_try_malloc0(sizeof(struct near_ndef_record));
if (record == NULL) {
err = ENOMEM;
+ g_free(type);
goto fail;
}
record->tnf = t_tnf;
record->type = r_type;
record->type_name = g_strndup((char *)type, type_length);
+ g_free(type);
switch (r_type) {
case RECORD_TYPE_WKT_SIZE: