From c86d055db77cdeef6049449ac79fe404c40d28cc Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 12 May 2014 14:58:15 -0300 Subject: Do not check for null before free. C specs says that we can safelly free a NULL pointer, so there's no reason to check if it's null before freeing it. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-gui.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'qt-gui.cpp') diff --git a/qt-gui.cpp b/qt-gui.cpp index 868389eab..9d6dde45f 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -165,10 +165,8 @@ void exit_ui(void) { delete window; delete application; - if (existing_filename) - free((void *)existing_filename); - if (default_dive_computer_device) - free((void *)default_dive_computer_device); + free((void *)existing_filename); + free((void *)default_dive_computer_device); } void set_filename(const char *filename, bool force) -- cgit v1.2.3-70-g09d2