Skip to content
Snippets Groups Projects
Commit 2da44762 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

m-simple-policy: find_endpoint: ref the endpoint only if it's not NULL

parent d236fea2
No related branches found
No related tags found
No related merge requests found
......@@ -294,8 +294,8 @@ simple_policy_find_endpoint (WpPolicy *policy, GVariant *props,
}
/* If not found, return the first endpoint */
ep = (ptr_array->len > 1) ? g_ptr_array_index (ptr_array, 0) : NULL;
return g_object_ref (ep);
return (ptr_array->len > 1) ?
g_object_ref (g_ptr_array_index (ptr_array, 0)) : NULL;
}
static void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment