diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-11-01 22:36:42 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-01 22:36:42 -0700 |
commit | 6ce0afb99ccbc5fe940c4ca727afcf9cd33dffd5 (patch) | |
tree | 160bff13cfc2309c9e4b7700d4b07c58ff4dd1b6 /qt-ui/maintab.cpp | |
parent | 6cf3787a0ed150fd7cd996d6ae54e9ed9eab7af5 (diff) | |
download | subsurface-6ce0afb99ccbc5fe940c4ca727afcf9cd33dffd5.tar.gz |
Don't call strdup on NULL by mistake
Hunting down a different issue I managed to cause a crash here when trying
to copy a string that ended up being NULL.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index fcb3cd362..d79536427 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -651,7 +651,7 @@ void MainTab::reload() #define EDIT_TEXT(what) \ if (same_string(mydive->what, cd->what)) { \ free(mydive->what); \ - mydive->what = strdup(displayed_dive.what); \ + mydive->what = copy_string(displayed_dive.what); \ } #define EDIT_VALUE(what) \ |