[gnome-color-manager/gnome-2-32] Clean up the temporary file created by cupsGetPPD2(). Fixes rh#582202.



commit 4bb0380f800a58d7100583acc0143844a7f05901
Author: Tim Waugh <twaugh redhat com>
Date:   Fri Apr 23 12:53:33 2010 +0100

    Clean up the temporary file created by cupsGetPPD2(). Fixes rh#582202.

 src/gcm-device-cups.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/gcm-device-cups.c b/src/gcm-device-cups.c
index db04d13..00cfebc 100644
--- a/src/gcm-device-cups.c
+++ b/src/gcm-device-cups.c
@@ -62,7 +62,7 @@ gcm_device_cups_set_from_dest (GcmDevice *device, http_t *http, cups_dest_t dest
 	gint i;
 	gboolean ret = TRUE;
 	ppd_file_t *ppd_file = NULL;
-	const gchar *ppd_file_location;
+	const gchar *ppd_file_location = NULL;
 	gchar *id = NULL;
 	gchar *device_id = NULL;
 	gchar *title = NULL;
@@ -167,8 +167,10 @@ out:
 	g_free (id);
 	g_free (device_id);
 	g_free (title);
-	if (ppd_file != NULL)
+	if (ppd_file != NULL) {
 		ppdClose (ppd_file);
+		unlink (ppd_file_location);
+	}
 	return ret;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]