From 7673e8a6dd08a3367e49a70e66d7cd6106ad045b Mon Sep 17 00:00:00 2001 From: Vinicius Costa Gomes Date: Tue, 18 Nov 2008 16:36:23 -0300 Subject: [PATCH] obexd: Avoids a memory leak when a async operation gets aborted --- obexd/gwobex/obex-priv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/obexd/gwobex/obex-priv.c b/obexd/gwobex/obex-priv.c index a08599fe3..7352cdc31 100644 --- a/obexd/gwobex/obex-priv.c +++ b/obexd/gwobex/obex-priv.c @@ -594,10 +594,11 @@ void obex_link_error(GwObex *ctx) { } if (ctx->xfer) { /* Check that buffer is owned by us */ - if (!(ctx->obex_op == OBEX_CMD_PUT && ctx->xfer->stream_fd < 0)) + if (!(ctx->obex_op == OBEX_CMD_PUT && ctx->xfer->stream_fd < 0)) { g_free(ctx->xfer->buf); - ctx->xfer->buf = NULL; - ctx->xfer->buf_size = 0; + ctx->xfer->buf = NULL; + ctx->xfer->buf_size = 0; + } ctx->xfer->do_cb = TRUE; } } -- 2.47.3