[gnome-desktop/wip/hadess/thumbnail-test-stats: 2/6] thumbnail: Plug memory leaks in test application
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop/wip/hadess/thumbnail-test-stats: 2/6] thumbnail: Plug memory leaks in test application
- Date: Wed, 14 Oct 2020 10:20:17 +0000 (UTC)
commit 41267156aa7923be0ecad40eeb884b040c6fe860
Author: Bastien Nocera <hadess hadess net>
Date: Wed Oct 14 11:38:41 2020 +0200
thumbnail: Plug memory leaks in test application
libgnome-desktop/test-desktop-thumbnail.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/libgnome-desktop/test-desktop-thumbnail.c b/libgnome-desktop/test-desktop-thumbnail.c
index e63bf263..0ded2030 100644
--- a/libgnome-desktop/test-desktop-thumbnail.c
+++ b/libgnome-desktop/test-desktop-thumbnail.c
@@ -29,8 +29,8 @@ thumbnail_file (GnomeDesktopThumbnailFactory *factory,
const char *in_path,
const char *out_path)
{
- GdkPixbuf *pixbuf;
- char *content_type;
+ g_autoptr(GdkPixbuf) pixbuf = NULL;
+ g_autofree char *content_type = NULL;
g_autoptr(GFile) file = NULL;
g_autofree char *path = NULL;
g_autofree char *uri = NULL;
@@ -45,7 +45,6 @@ thumbnail_file (GnomeDesktopThumbnailFactory *factory,
content_type = g_content_type_guess (path, NULL, 0, NULL);
uri = g_file_get_uri (file);
pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (factory, uri, content_type);
- g_free (content_type);
if (pixbuf == NULL) {
g_warning ("gnome_desktop_thumbnail_factory_generate_thumbnail() failed to generate a
thumbnail for %s", in_path);
@@ -62,7 +61,7 @@ thumbnail_file (GnomeDesktopThumbnailFactory *factory,
int main (int argc, char **argv)
{
- GnomeDesktopThumbnailFactory *factory;
+ g_autoptr(GnomeDesktopThumbnailFactory) factory = NULL;
if (argc != 3) {
g_print ("Usage: %s [INPUT FILE] [OUTPUT FILE]\n", argv[0]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]