]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librgw: fix uninitialized rgw_fh
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 2 Dec 2015 02:04:40 +0000 (21:04 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 12 Feb 2016 17:06:11 +0000 (12:06 -0500)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_file.cc

index eb7c7c99398b75b02a55213f4b296648050a015a..a7cce8b2019d2b4f30b47993d7379e883b30bf42 100644 (file)
@@ -177,6 +177,7 @@ int rgw_mkdir(struct rgw_fs *rgw_fs,
   if (parent->is_root()) {
     /* bucket */
     fhr = fs->lookup_fh(parent, name);
+    rgw_fh = get<0>(fhr);
     uri += "/"; /* XXX */
     uri += name;
     RGWCreateBucketRequest req(cct, fs->get_user(), uri);
@@ -185,13 +186,13 @@ int rgw_mkdir(struct rgw_fs *rgw_fs,
     /* create an object representing the directory (naive version) */
     buffer::list bl;
     fhr = fs->lookup_fh(parent, name, RGWFileHandle::FLAG_PSEUDO);
+    rgw_fh = get<0>(fhr);
     string dir_name = rgw_fh->full_object_name() + "/";
     RGWPutObjRequest req(cct, fs->get_user(), rgw_fh->bucket_name(),
                         dir_name, bl);
     rc = librgw.get_fe()->execute_req(&req);
   }
 
-  rgw_fh = get<0>(fhr);
   struct rgw_file_handle *rfh = rgw_fh->get_fh();
   *fh = rfh;