[seahorse] Bug 604541 - wrong use of gdk_property_get



commit 8572a86718b4f8d07417713eafe597ba7b09c165
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 2 18:17:47 2010 -0500

    Bug 604541 - wrong use of gdk_property_get
    
    Check return value of gdk_property_get before returning value.

 src/seahorse-key-manager-store.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/seahorse-key-manager-store.c b/src/seahorse-key-manager-store.c
index ac468c5..ea4c929 100644
--- a/src/seahorse-key-manager-store.c
+++ b/src/seahorse-key-manager-store.c
@@ -407,13 +407,14 @@ xds_get_atom_value (GdkDragContext *context)
 	g_return_val_if_fail (context != NULL, NULL);
 	g_return_val_if_fail (context->source_window != NULL, NULL);
 
-	gdk_property_get (context->source_window,
-			  XDS_ATOM, TEXT_ATOM,
-			  0, MAX_XDS_ATOM_VAL_LEN,
-			  FALSE, NULL, NULL, NULL,
-			  (unsigned char **) &ret);
-
-	return ret;
+	if (gdk_property_get (context->source_window,
+			      XDS_ATOM, TEXT_ATOM,
+			      0, MAX_XDS_ATOM_VAL_LEN,
+			      FALSE, NULL, NULL, NULL,
+			      (unsigned char **) &ret))
+		return ret;
+
+	return NULL;
 }
 
 static gboolean



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