talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit f9816ddf416fb29d199d57a53a87c932e5dc9895
parent 86c33788de5d398c63d646f0fe02e205ea37683e
Author: Ricardo Mones <ricardo@mones.org>
Date:   Thu, 23 Oct 2014 09:56:19 +0200

Free newly created strings from g_markup_printf_escaped

Fixes also build with hardening flags:
• rssyl_update_feed.c:124:6: error: format not a string literal and no
  format arguments [-Werror=format-security]
• rssyl_update_feed.c:135:8: error: format not a string literal and no
  format arguments [-Werror=format-security]
• rssyl_update_feed.c:222:6: error: format not a string literal and no
  format arguments [-Werror=format-security]

Diffstat:
Msrc/plugins/rssyl/rssyl_update_feed.c | 31++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/src/plugins/rssyl/rssyl_update_feed.c b/src/plugins/rssyl/rssyl_update_feed.c @@ -118,10 +118,14 @@ void rssyl_fetch_feed(RFetchCtx *ctx, gboolean verbose) if( ctx->error != NULL ) { /* libcurl wasn't happy */ debug_print("RSSyl: Error: %s\n", ctx->error); - if( verbose ) - alertpanel_error(g_markup_printf_escaped(C_("First parameter is URL, second is error text", + if( verbose ) { + gchar *msg = g_markup_printf_escaped( + (const char *) C_("First parameter is URL, second is error text", "Error fetching feed at\n<b>%s</b>:\n\n%s"), - feed_get_url(ctx->feed), ctx->error)); + feed_get_url(ctx->feed), ctx->error); + alertpanel_error("%s", msg); + g_free(msg); + } log_error(LOG_PROTOCOL, RSSYL_LOG_ERROR_FETCH, ctx->feed->url, ctx->error); @@ -130,9 +134,13 @@ void rssyl_fetch_feed(RFetchCtx *ctx, gboolean verbose) if( feed_get_title(ctx->feed) == NULL ) { /* libcurl was happy, but libfeed wasn't */ debug_print("RSSyl: Error reading feed\n"); - if( verbose ) - alertpanel_error(g_markup_printf_escaped(_("No valid feed found at\n<b>%s</b>"), - feed_get_url(ctx->feed))); + if( verbose ) { + gchar *msg = g_markup_printf_escaped( + (const char *) _("No valid feed found at\n<b>%s</b>"), + feed_get_url(ctx->feed)); + alertpanel_error("%s", msg); + g_free(msg); + } log_error(LOG_PROTOCOL, RSSYL_LOG_ERROR_NOFEED, feed_get_url(ctx->feed)); @@ -217,9 +225,14 @@ gboolean rssyl_update_feed(RFolderItem *ritem, gboolean verbose) if( ctx->success && !(ctx->success = rssyl_parse_feed(ritem, ctx->feed)) ) { /* both libcurl and libfeed were happy, but we weren't */ debug_print("RSSyl: Error processing feed\n"); - if( verbose ) - alertpanel_error(g_markup_printf_escaped(_("Couldn't process feed at\n<b>%s</b>\n\nPlease contact developers, this should not happen."), - feed_get_url(ctx->feed))); + if( verbose ) { + gchar *msg = g_markup_printf_escaped( + (const char *) _("Couldn't process feed at\n<b>%s</b>\n\n" + "Please contact developers, this should not happen."), + feed_get_url(ctx->feed)); + alertpanel_error("%s", msg); + g_free(msg); + } log_error(LOG_PROTOCOL, RSSYL_LOG_ERROR_PROC, ctx->feed->url); }