aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2011-09-19 20:19:43 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2011-09-19 20:19:43 +0000
commit5b85e16735edab8cdc918461a04cbf98174aedfe (patch)
tree23b38cad49082ff74d4777b4849c0e02da03e406 /gtk
parent7012c496c97d99ab26bdf821c7209ec6b86c4fa1 (diff)
Move the return out of the for() loop so all values are freed. Fixes Coverity CID 1277 (loop increment j++ is unreachable).
svn path=/trunk/; revision=39053
Diffstat (limited to 'gtk')
-rw-r--r--gtk/decode_as_dlg.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gtk/decode_as_dlg.c b/gtk/decode_as_dlg.c
index 39991c696f..e79a0568a2 100644
--- a/gtk/decode_as_dlg.c
+++ b/gtk/decode_as_dlg.c
@@ -291,17 +291,13 @@ read_set_decode_as_entries(gchar *key, gchar *value,
void *user_data _U_,
gboolean return_range_errors _U_)
{
- gchar *values[4];
+ gchar *values[4] = {NULL, NULL, NULL, NULL};
gchar delimiter[4] = {',', ',', ',','\0'};
gchar *pch;
guint i, j;
dissector_table_t sub_dissectors;
prefs_set_pref_e retval = PREFS_SET_OK;
- for (i = 0; i < 4; i++) {
- values[i] = NULL;
- }
-
if (strcmp(key, DECODE_AS_ENTRY) == 0) {
/* Parse csv into table, selector, initial, current */
for (i = 0; i < 4; i++) {
@@ -309,8 +305,8 @@ read_set_decode_as_entries(gchar *key, gchar *value,
if (pch == NULL) {
for (j = 0; j < i; j++) {
g_free(values[j]);
- return PREFS_SET_SYNTAX_ERR;
}
+ return PREFS_SET_SYNTAX_ERR;
}
values[i] = g_strndup(value, pch - value);
value = pch + 1;