Commit df22949a3566e2514c963d9eec2f0e82c05a18e9

Carlos Martín Nieto 2011-03-31T12:51:17

config_set: really replace the value on overwrite Signed-off-by: Carlos Martín Nieto <cmn@elego.de>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/config.c b/src/config.c
index 13c32bc..0870ce6 100644
--- a/src/config.c
+++ b/src/config.c
@@ -163,8 +163,8 @@ static int config_set(git_config *cfg, const char *name, const char *value)
 		if (tmp == NULL)
 			return GIT_ENOMEM;
 
-		free(var->value);
-		var->value = tmp;
+		free(existing->value);
+		existing->value = tmp;
 
 		return GIT_SUCCESS;
 	}