Commit ecbc80b0 authored by Bastien Nocera's avatar Bastien Nocera

plazes: Fix crash handling MAC addresses

The MAC address was already lower-case, and we weren't freeing the newly
allocated lower-case version, but the original version twice.

https://bugzilla.redhat.com/show_bug.cgi?id=1091355
parent 79b589c8
......@@ -125,7 +125,7 @@ geoclue_plazes_get_position (GcIfacePosition *iface,
GError **error)
{
GeocluePlazes *plazes;
char *mac, *mac_lc;
char *mac;
plazes = (GEOCLUE_PLAZES (iface));
......@@ -147,12 +147,10 @@ geoclue_plazes_get_position (GcIfacePosition *iface,
geoclue_plazes_set_status (plazes, GEOCLUE_STATUS_ACQUIRING);
mac_lc = g_ascii_strdown (mac, -1);
g_free (mac);
if (!gc_web_service_query (plazes->web_service, error,
PLAZES_KEY_MAC, mac,
(char *)0)) {
g_free (mac_lc);
g_free (mac);
// did not get a reply; we can try again later
geoclue_plazes_set_status (plazes, GEOCLUE_STATUS_AVAILABLE);
g_set_error (error, GEOCLUE_ERROR,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment