]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/rgw_main.cc: close leak in error case
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 31 Jan 2017 18:13:48 +0000 (19:13 +0100)
committerSage Weil <sage@redhat.com>
Thu, 9 Feb 2017 02:54:25 +0000 (21:54 -0500)
ID 1398895 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable config going out of scope leaks
 the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rgw/rgw_main.cc

index 0330e322f4cb90196b9aeba3051b46c3fa4d70e6..437f68e2de76e40741e8f00a3609e576b0b570f3 100644 (file)
@@ -250,6 +250,7 @@ int main(int argc, const char **argv)
     RGWFrontendConfig *config = new RGWFrontendConfig(f);
     int r = config->init();
     if (r < 0) {
+      delete config;
       cerr << "ERROR: failed to init config: " << f << std::endl;
       return EINVAL;
     }