diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-01-01 17:27:33 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-01 17:27:33 -0800 |
commit | 030d0c1294bf6c90c3a58e6678dc56760d197bcb (patch) | |
tree | e742d365a2fc88ea9091fdd101f71b3d8e38dc51 | |
parent | 8fa81a5577b71e72a22186bf7dd0e07e58c1c49a (diff) | |
download | subsurface-030d0c1294bf6c90c3a58e6678dc56760d197bcb.tar.gz |
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 <dirk@hohndel.org>
-rw-r--r-- | gtk-gui.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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)); |