From e12bb2e1ae504c518316ef3aa5b436a6d80c497a Mon Sep 17 00:00:00 2001 From: "kibak.yoon" Date: Tue, 22 Oct 2013 19:20:59 +0900 Subject: [PATCH] clean code & delete checking the pointer that is dereference already Change-Id: Ifdd9eda8289cac5d4288b467d80395a9c4f4af01 Signed-off-by: kibak.yoon Signed-off-by: Jacek Pielaszkiewicz --- server/src/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/main.cpp b/server/src/main.cpp index ff26efb..4a3b7a1 100644 --- a/server/src/main.cpp +++ b/server/src/main.cpp @@ -332,7 +332,7 @@ int main(int argc, char *argv[]) filter_catalog = new cfilter_catalog; } catch (...) { ERR("cfilter_catalog class create fail\n"); - if (sensor_catalog) delete sensor_catalog; + delete sensor_catalog; if (processor_catalog) delete processor_catalog; return -1; } @@ -343,7 +343,7 @@ int main(int argc, char *argv[]) if (filter_catalog->create(dstream_file) == false) { ERR("filter_catalog create fail\n"); delete filter_catalog; - if (sensor_catalog) delete sensor_catalog; + delete sensor_catalog; if (processor_catalog) delete processor_catalog; return -1; } @@ -352,8 +352,8 @@ int main(int argc, char *argv[]) processor_catalog = new cprocessor_catalog; } catch (...) { ERR("cprocessor_catalog class create fail\n"); - if (sensor_catalog) delete sensor_catalog; - if (filter_catalog) delete filter_catalog; + delete sensor_catalog; + delete filter_catalog; return -1; } @@ -363,8 +363,8 @@ int main(int argc, char *argv[]) if (processor_catalog->create(dstream_file) == false) { ERR("processor_catalog create fail\n"); delete processor_catalog; - if (sensor_catalog) delete sensor_catalog; - if (filter_catalog) delete filter_catalog; + delete sensor_catalog; + delete filter_catalog; return -1; } -- 2.7.4