diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2012-05-14 16:46:01 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2012-05-15 10:27:28 +0300 |
commit | 473f99dfef50018461980320727640874701a6de (patch) | |
tree | 4f6e996fd4fcf2bd80c8501e496f763ca5d41003 /client/pbap.c | |
parent | 281c82901db45da5eb9489d4aba56052379a7ad3 (diff) | |
download | obexd-473f99dfef50018461980320727640874701a6de.tar.gz |
client: Use stack memory for application parameters in pbap module
The maximum amount needed is known and sufficiently small to be in the
stack which is much simpler to deal with.
Diffstat (limited to 'client/pbap.c')
-rw-r--r-- | client/pbap.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/client/pbap.c b/client/pbap.c index 7970c8e..76db61e 100644 --- a/client/pbap.c +++ b/client/pbap.c @@ -531,7 +531,7 @@ static DBusMessage *pull_vcard_listing(struct pbap_data *pbap, { struct pending_request *request; struct obc_transfer *transfer; - guint8 *p, *apparam = NULL; + guint8 *p, apparam[272]; gint apparam_size; GError *err = NULL; DBusMessage *reply; @@ -549,7 +549,6 @@ static DBusMessage *pull_vcard_listing(struct pbap_data *pbap, (APPARAM_HDR_SIZE + SEARCHATTRIB_LEN) + (APPARAM_HDR_SIZE + MAXLISTCOUNT_LEN) + (APPARAM_HDR_SIZE + LISTSTARTOFFSET_LEN); - apparam = g_malloc0(apparam_size); p = apparam; @@ -566,7 +565,6 @@ static DBusMessage *pull_vcard_listing(struct pbap_data *pbap, request = pending_request_new(pbap, message); obc_transfer_set_params(transfer, apparam, apparam_size); - g_free(apparam); if (obc_session_queue(pbap->session, transfer, pull_vcard_listing_callback, request, &err)) |