[tracker-miners/wip/carlosg/coverity-fixes: 7/28] tracker-extract: Move variable initialization
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/coverity-fixes: 7/28] tracker-extract: Move variable initialization
- Date: Sun, 24 Oct 2021 11:33:39 +0000 (UTC)
commit e7e3bfde730f13d965176751dcfd0776f70c1c2a
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Oct 24 00:23:28 2021 +0200
tracker-extract: Move variable initialization
Otherwise it could be leaked in between, due to early returns.
CID: #365650
src/tracker-extract/tracker-extract-png.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-png.c b/src/tracker-extract/tracker-extract-png.c
index c793b968e..a5635f1c5 100644
--- a/src/tracker-extract/tracker-extract-png.c
+++ b/src/tracker-extract/tracker-extract-png.c
@@ -139,14 +139,13 @@ raw_profile_new (const gchar *input,
size++;
} while (g_ascii_isdigit (*ptr));
- length_str = g_strndup (length_ptr, size - 1);
-
if (*ptr != '\n') {
return NULL;
}
ptr++;
+ length_str = g_strndup (length_ptr, size - 1);
length = atoi (length_str);
g_free (length_str);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]