diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-12-18 10:47:00 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-12-18 08:34:00 -0800 |
commit | 8d54c9640d028bfc51b02ff8cffe14b36bc5f51a (patch) | |
tree | 68ced2818c8d382edf5e29cff8a48fec7f3a0611 | |
parent | 65a988a232da68f0cdeaf34fe7aebba16bc0c76b (diff) | |
download | subsurface-8d54c9640d028bfc51b02ff8cffe14b36bc5f51a.tar.gz |
Free any previous userid before setting new
When we load multiple files, we call set_userid multiple times. Then we
need to free the old user id before we set a new.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | dive.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2749,6 +2749,8 @@ void set_save_userid_local(short value) void set_userid(char *rUserId) { + if (prefs.userid) + free(prefs.userid); prefs.userid = strdup(rUserId); if (strlen(prefs.userid) > 30) prefs.userid[30]='\0'; |