Fix Coverity issues in Bluetooth-frwk
[platform/core/connectivity/bluetooth-frwk.git] / bt-otp / bt-otpserver.c
index 93d3c50..f44f487 100644 (file)
@@ -815,6 +815,9 @@ fail:
                                _bt_otp_start_write_on_fd();
                        else if (oacp_op->opcode == OACP_WRITE)
                                _bt_otp_start_read_on_fd();
+               } else {
+                       /* Close fd if oacp_op is NULL */
+                       close(fd);
                }
                g_dbus_method_invocation_return_value(invocation, NULL);
        }