From 6ce0afb99ccbc5fe940c4ca727afcf9cd33dffd5 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 1 Nov 2014 22:36:42 -0700 Subject: [PATCH] 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 --- qt-ui/maintab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) \