projects
/
profile
/
ivi
/
lemolo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf60804
)
ofono: fix error handling memory cleanup order.
author
Gustavo Sverzut Barbieri
<barbieri@profusion.mobi>
Tue, 25 Sep 2012 18:27:14 +0000
(15:27 -0300)
committer
Gustavo Sverzut Barbieri
<barbieri@profusion.mobi>
Tue, 25 Sep 2012 19:13:50 +0000
(16:13 -0300)
we must cleanup the stringshares only if the ctx was successfully
created, that also mean we must cleanup the stringshares before we
dispatch the callback. The order was reversed.
utils/ofono.c
patch
|
blob
|
history
diff --git
a/utils/ofono.c
b/utils/ofono.c
index
5f6466d
..
ad993eb
100644
(file)
--- a/
utils/ofono.c
+++ b/
utils/ofono.c
@@
-3250,7
+3250,7
@@
OFono_Pending *ofono_sms_send(const char *number, const char *message,
bus_id, m->base.path, OFONO_PREFIX OFONO_MSG_IFACE,
"SendMessage");
if (!msg)
- goto error;
+ goto error
_setup
;
if (!dbus_message_append_args(msg, DBUS_TYPE_STRING, &number,
DBUS_TYPE_STRING, &message,
@@
-3263,11
+3263,12
@@
OFono_Pending *ofono_sms_send(const char *number, const char *message,
error_message:
dbus_message_unref(msg);
+error_setup:
+ eina_stringshare_del(ctx->destination);
+ eina_stringshare_del(ctx->message);
error:
if (cb)
cb((void *)data, err, NULL);
- eina_stringshare_del(ctx->destination);
- eina_stringshare_del(ctx->message);
free(ctx);
return NULL;
}