[easytag] Remove bogus conditional check in settings parser
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Remove bogus conditional check in settings parser
- Date: Wed, 5 Feb 2014 17:42:12 +0000 (UTC)
commit 7305451e0e967a2fdd5e0d59e364357a9a338fcb
Author: David King <amigadave amigadave com>
Date: Mon Feb 3 16:31:46 2014 +0000
Remove bogus conditional check in settings parser
Found with Coverity (CID 1163352).
src/setting.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/src/setting.c b/src/setting.c
index 1186b4f..03c888c 100644
--- a/src/setting.c
+++ b/src/setting.c
@@ -1060,17 +1060,13 @@ Set_Config (gchar *line)
case CV_TYPE_STRING:
{
- if (!var_value)
- {
- *(char **)Config_Variables[i].pointer = NULL;
- //g_print("\nConfig File Warning: Field of '%s' has no value!\n",var_descriptor);
- } else
+
+ if (*(char **)Config_Variables[i].pointer != NULL)
{
- if ( *(char **)Config_Variables[i].pointer != NULL )
- g_free(*(char **)Config_Variables[i].pointer);
- *(char **)Config_Variables[i].pointer = g_malloc(strlen(var_value)+1);
- strcpy( *(char **)Config_Variables[i].pointer,var_value );
+ g_free (*(char **)Config_Variables[i].pointer);
}
+
+ *(char **)Config_Variables[i].pointer = g_strdup (var_value);
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]