hal/libhal libhal.c,1.32,1.32.2.1

David Zeuthen david at freedesktop.org
Thu Jan 6 19:18:56 PST 2005


Update of /cvs/hal/hal/libhal
In directory gabe:/tmp/cvs-serv6121/libhal

Modified Files:
      Tag: hal-0_4-stable-branch
	libhal.c 
Log Message:
2005-01-06  David Zeuthen  <davidz at redhat.com>

	* libhal/libhal.c (hal_device_query_capability): Patch from Tim
	Müller <t.i.m at zen.co.uk>. The attached patch fixes a small memory
	leak in libhal's hal_device_query_capability().



Index: libhal.c
===================================================================
RCS file: /cvs/hal/hal/libhal/libhal.c,v
retrieving revision 1.32
retrieving revision 1.32.2.1
diff -u -d -r1.32 -r1.32.2.1
--- libhal.c	14 Oct 2004 18:37:28 -0000	1.32
+++ libhal.c	7 Jan 2005 03:18:53 -0000	1.32.2.1
@@ -2230,15 +2230,13 @@
 hal_device_query_capability (LibHalContext *ctx, 
 			     const char *udi, const char *capability)
 {
+	dbus_bool_t ret;
 	char *caps;
 
 	caps = hal_device_get_property_string (ctx, udi, "info.capabilities");
-
-	if (caps != NULL)
-		if (strstr (caps, capability) != NULL)
-			return TRUE;
-
-	return FALSE;
+	ret = (caps != NULL && strstr (caps, capability) != NULL);
+	hal_free_string (caps);
+	return ret;
 }
 
 /** Find devices with a given capability. 




More information about the hal-commit mailing list