]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/cephfs/cephfs.pyx
update sources to v12.2.3
[ceph.git] / ceph / src / pybind / cephfs / cephfs.pyx
index 806e0ab4c3756365a09d0fc63ed629a7628206fe..3f106c4dfc6a9922a97b8d8272b5281b595d3cc1 100644 (file)
@@ -962,10 +962,10 @@ cdef class LibCephFS(object):
             char *_inbuf = input_data
             size_t _inbuf_len = len(input_data)
 
-            char *_outbuf
-            size_t _outbuf_len
-            char *_outs
-            size_t _outs_len
+            char *_outbuf = NULL
+            size_t _outbuf_len = 0
+            char *_outs = NULL
+            size_t _outs_len = 0
 
         try:
             with nogil:
@@ -974,15 +974,12 @@ cdef class LibCephFS(object):
                                        <const char*>_inbuf, _inbuf_len,
                                        &_outbuf, &_outbuf_len,
                                        &_outs, &_outs_len)
-            if ret == 0:
-                my_outs = decode_cstr(_outs[:_outs_len])
-                my_outbuf = _outbuf[:_outbuf_len]
-                if _outs_len:
-                    ceph_buffer_free(_outs)
-                if _outbuf_len:
-                    ceph_buffer_free(_outbuf)
-                return (ret, my_outbuf, my_outs)
-            else:
-                return (ret, b"", "")
+            my_outs = decode_cstr(_outs[:_outs_len])
+            my_outbuf = _outbuf[:_outbuf_len]
+            if _outs_len:
+                ceph_buffer_free(_outs)
+            if _outbuf_len:
+                ceph_buffer_free(_outbuf)
+            return (ret, my_outbuf, my_outs)
         finally:
             free(_cmd)