[tracker/tracker-0.8] tracker-tag: Fix coverity report
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.8] tracker-tag: Fix coverity report
- Date: Thu, 6 May 2010 17:55:39 +0000 (UTC)
commit 2786828528bdf7b8e19a5db75829f968d62ac263
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue May 4 11:51:59 2010 +0200
tracker-tag: Fix coverity report
urns was possibly uninitialized when used. Also, removed the uris
variable declaration inside the if (uris && *uris) block, since
it was obviously redeclared and reused for exactly the same purpose.
src/tracker-utils/tracker-tag.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/tracker-utils/tracker-tag.c b/src/tracker-utils/tracker-tag.c
index 5ea1e28..70a9fc0 100644
--- a/src/tracker-utils/tracker-tag.c
+++ b/src/tracker-utils/tracker-tag.c
@@ -622,7 +622,7 @@ remove_tag_for_urns (TrackerClient *client,
GStrv files,
const gchar *tag)
{
- GPtrArray *urns;
+ GPtrArray *urns = NULL;
GError *error = NULL;
gchar *tag_escaped;
gchar *query;
@@ -635,7 +635,7 @@ remove_tag_for_urns (TrackerClient *client,
GPtrArray *results;
gchar *filter;
const gchar *urn;
- GStrv uris, urns_strv;
+ GStrv urns_strv;
/* Get all tags urns */
query = g_strdup_printf ("SELECT ?tag "
@@ -654,6 +654,7 @@ remove_tag_for_urns (TrackerClient *client,
error->message);
g_error_free (error);
g_free (tag_escaped);
+ g_strfreev (uris);
return FALSE;
}
@@ -663,13 +664,12 @@ remove_tag_for_urns (TrackerClient *client,
_("No tags were found by that name"));
g_free (tag_escaped);
+ g_strfreev (uris);
return TRUE;
}
urn = * (GStrv) results->pdata[0];
-
- uris = get_uris (files);
urns = get_file_urns (client, uris, urn);
if (!urns || urns->len == 0) {
@@ -719,6 +719,7 @@ remove_tag_for_urns (TrackerClient *client,
_("Could not remove tag"),
error->message);
g_error_free (error);
+ g_strfreev (uris);
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]