Re: [PATCH] obexd/map: msg dummy implement MSE message viewing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux