From 030d0c1294bf6c90c3a58e6678dc56760d197bcb Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 1 Jan 2013 17:27:33 -0800 Subject: Make sure remember_dc has its own copy of the model string When called from the parser the model string is freed right after passing it to remember_dc. So we need to get our own copy. Signed-off-by: Dirk Hohndel --- gtk-gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk-gui.c b/gtk-gui.c index fdd4c8e23..95de4e1cb 100644 --- a/gtk-gui.c +++ b/gtk-gui.c @@ -2289,7 +2289,7 @@ void remember_dc(const char *model, uint32_t deviceid, const char *nickname, gbo char buffer[160]; struct dcnicknamelist *nn_entry = malloc(sizeof(struct dcnicknamelist)); nn_entry->deviceid = deviceid; - nn_entry->model = model; + nn_entry->model = strdup(model); /* make sure there are no curly braces or commas in the string and that * it will fit in the buffer */ nn_entry->nickname = cleanedup_nickname(nickname, sizeof(buffer) - 13 - strlen(model)); -- cgit v1.2.3-70-g09d2