From: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
To: Sathish Narasimman <nsathish41@gmail.com>
Cc: <linux-bluetooth@vger.kernel.org>,
Sathish Narasimman <sathish.narasimman@intel.com>
Subject: Re: [PATCH] obexd/map: msg dummy implement MSE message viewing
Date: Thu, 6 Jul 2017 14:15:15 +0900 [thread overview]
Message-ID: <222dcd39-0ee0-2467-bb41-90d66e9a7715@jp.fujitsu.com> (raw)
In-Reply-To: <1499252831-29074-1-git-send-email-nsathish41@gmail.com>
Hi Sathish,
> @@ -518,7 +545,26 @@ int messages_get_message(void *session, const char *handle,
> messages_get_message_cb callback,
> void *user_data)
> {
> - return -ENOSYS;
> + struct session *s = session;
> + struct message_view_data *mvd;
> +
> + mvd = g_new0(struct message_view_data, 1);
> + mvd->session = s;
> + mvd->handle = handle;
> + mvd->callback = callback;
> + mvd->user_data = user_data;
> +
> + mvd->path = g_build_filename(s->cwd_absolute, handle, NULL);
> + mvd->fp = fopen(mvd->path, "r");
> + if (mvd->fp == NULL) {
> + int err = -errno;
> + DBG("fopen(): %d, %s", -err, strerror(-err));
> + g_free(mvd->path);
> + return -ENOENT;
I think the memory of mvd leaks when fopen fails.
Regards,
Eramoto
next prev parent reply other threads:[~2017-07-06 5:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-05 11:07 [PATCH] obexd/map: msg dummy implement MSE message viewing Sathish Narasimman
2017-07-06 5:15 ` ERAMOTO Masaya [this message]
2017-07-06 7:13 ` Sathish Narasimman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=222dcd39-0ee0-2467-bb41-90d66e9a7715@jp.fujitsu.com \
--to=eramoto.masaya@jp.fujitsu.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=nsathish41@gmail.com \
--cc=sathish.narasimman@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox