浏览代码

totemconfig: Reuse already fetched pointer

Make code a bit readable and easier to process for coverity.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Jan Friesse 6 年之前
父节点
当前提交
e925e389a2
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      exec/totemconfig.c

+ 1 - 1
exec/totemconfig.c

@@ -214,7 +214,7 @@ static void totem_volatile_config_set_string_value (struct totem_config *totem_c
 
 
 	config_value = totem_get_param_by_name(totem_config, key_name);
 	config_value = totem_get_param_by_name(totem_config, key_name);
 	old_config_ptr = *config_value;
 	old_config_ptr = *config_value;
-	if (icmap_get_string(key_name, totem_get_param_by_name(totem_config, key_name)) != CS_OK ||
+	if (icmap_get_string(key_name, (char **)config_value) != CS_OK ||
 	    (deleted_key != NULL && strcmp(deleted_key, key_name) == 0)) {
 	    (deleted_key != NULL && strcmp(deleted_key, key_name) == 0)) {
 
 
 		/* Need to strdup() here so that the free() below works for a default and a configured value */
 		/* Need to strdup() here so that the free() below works for a default and a configured value */