From e050eec7d4fb4f96233b55b9cfdc75ff2bccda11 Mon Sep 17 00:00:00 2001 From: Max Parmer Date: Mon, 21 Mar 2016 20:43:33 -0700 Subject: Removes third-party libstrophe patches. --- .../libstrophe-fix-memory-leak-in-logging.patch | 64 ---------------------- 1 file changed, 64 deletions(-) delete mode 100644 dev-libs/libstrophe/files/libstrophe-fix-memory-leak-in-logging.patch (limited to 'dev-libs/libstrophe/files/libstrophe-fix-memory-leak-in-logging.patch') diff --git a/dev-libs/libstrophe/files/libstrophe-fix-memory-leak-in-logging.patch b/dev-libs/libstrophe/files/libstrophe-fix-memory-leak-in-logging.patch deleted file mode 100644 index 4537d8f..0000000 --- a/dev-libs/libstrophe/files/libstrophe-fix-memory-leak-in-logging.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff --git a/src/ctx.c b/src/ctx.c -index 48e87ad..5a24687 100644 ---- a/src/ctx.c -+++ b/src/ctx.c -@@ -249,30 +249,38 @@ void xmpp_log(const xmpp_ctx_t * const ctx, - { - int oldret, ret; - char smbuf[1024]; -- char *buf; -- va_list copy; -+ char *bigbuf = NULL; -+ va_list ap_copy; - -- buf = smbuf; -- va_copy(copy, ap); -- ret = xmpp_vsnprintf(buf, 1023, fmt, ap); -+ va_copy(ap_copy, ap); -+ ret = xmpp_vsnprintf(smbuf, 1023, fmt, ap_copy); -+ va_end(ap_copy); - if (ret > 1023) { -- va_copy(ap, copy); -- buf = (char *)xmpp_alloc(ctx, ret + 1); -- if (!buf) { -- buf = NULL; -- xmpp_error(ctx, "log", "Failed allocating memory for log message."); -- return; -- } -- oldret = ret; -- ret = xmpp_vsnprintf(buf, ret + 1, fmt, ap); -- if (ret > oldret) { -- xmpp_error(ctx, "log", "Unexpected error"); -- return; -- } -+ bigbuf = (char *)xmpp_alloc(ctx, ret + 1); -+ if (!bigbuf) { -+ bigbuf = NULL; -+ xmpp_error(ctx, "log", "Failed allocating memory for log message."); -+ return; -+ } -+ oldret = ret; -+ va_copy(ap_copy, ap); -+ ret = xmpp_vsnprintf(bigbuf, ret + 1, fmt, ap_copy); -+ va_end(ap_copy); -+ -+ if (ret > oldret) { -+ xmpp_error(ctx, "log", "Unexpected error"); -+ return; -+ } -+ -+ if (ctx->log->handler) { -+ ctx->log->handler(ctx->log->userdata, level, area, bigbuf); -+ } -+ xmpp_free(ctx, bigbuf); -+ } else { -+ if (ctx->log->handler) { -+ ctx->log->handler(ctx->log->userdata, level, area, smbuf); -+ } - } -- -- if (ctx->log->handler) -- ctx->log->handler(ctx->log->userdata, level, area, buf); - } - - /** Write to the log at the ERROR level. -- cgit v1.2.1