[gnome-software] trivial: Use g_autoptr() for the SoupURI
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Use g_autoptr() for the SoupURI
- Date: Mon, 15 Aug 2016 08:34:43 +0000 (UTC)
commit 10e988f848441fdf55362a15bf10fcd6b047eeb8
Author: Richard Hughes <richard hughsie com>
Date: Mon Aug 15 09:34:17 2016 +0100
trivial: Use g_autoptr() for the SoupURI
The soup_uri_free() function is not NULL safe.
Resolves: https://bugzilla.gnome.org/show_bug.cgi?id=762689
src/gs-screenshot-image.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/src/gs-screenshot-image.c b/src/gs-screenshot-image.c
index 267baa5..01fbcf4 100644
--- a/src/gs-screenshot-image.c
+++ b/src/gs-screenshot-image.c
@@ -318,12 +318,12 @@ gs_screenshot_image_load_async (GsScreenshotImage *ssimg,
GCancellable *cancellable)
{
AsImage *im = NULL;
- SoupURI *base_uri = NULL;
const gchar *url;
g_autofree gchar *basename = NULL;
g_autofree gchar *cache_kind = NULL;
g_autofree gchar *cachefn_thumb = NULL;
g_autofree gchar *sizedir = NULL;
+ g_autoptr(SoupURI) base_uri = NULL;
g_return_if_fail (GS_IS_SCREENSHOT_IMAGE (ssimg));
@@ -422,7 +422,6 @@ gs_screenshot_image_load_async (GsScreenshotImage *ssimg,
/* TRANSLATORS: this is when we try to download a screenshot
* that was not a valid URL */
gs_screenshot_image_set_error (ssimg, _("Screenshot not valid"));
- soup_uri_free (base_uri);
return;
}
@@ -438,7 +437,6 @@ gs_screenshot_image_load_async (GsScreenshotImage *ssimg,
if (ssimg->message == NULL) {
/* TRANSLATORS: this is when networking is not available */
gs_screenshot_image_set_error (ssimg, _("Screenshot not available"));
- soup_uri_free (base_uri);
return;
}
@@ -447,7 +445,6 @@ gs_screenshot_image_load_async (GsScreenshotImage *ssimg,
g_object_ref (ssimg->message) /* transfer full */,
gs_screenshot_image_complete_cb,
g_object_ref (ssimg));
- soup_uri_free (base_uri);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]