]> pilppa.com Git - libplpbus.git/commitdiff
Crash fix for unhandled msg request case in server.
authorMika Laitio <lamikr@pilppa.org>
Sun, 6 Mar 2011 08:42:52 +0000 (10:42 +0200)
committerMika Laitio <lamikr@pilppa.org>
Sun, 6 Mar 2011 08:42:52 +0000 (10:42 +0200)
Fixed the bus msg response crash in case when the server did not handle the
message and returned null.

Signed-off-by: Mika Laitio <lamikr@pilppa.org>
src/plpbus/OrbServerImpl.cc

index 1c8bfb5724f16a785f45962c3c8d04289e12a072..3fa74a005dd95e1e05e5607617d68c8dcd4ddd2a 100644 (file)
@@ -105,11 +105,16 @@ CORBA::Long OrbServerImpl::send_dataitem_message_and_wait_response(const DataIte
        BusMessage              *msg_rsp;
        DataItemSequence        *seq;
 
-       msg_req = new BusMessageInternal(req_seq_param);
+       seq     = NULL;
        msg_rsp = NULL;
+       msg_req = new BusMessageInternal(req_seq_param);
        _listener->request_received(msg_req, &msg_rsp);
-       //rsp_seq_param = new DataItemSequence_out(msg_rsp._dataItemSeq);
-       seq                     = (DataItemSequence *)msg_rsp->_dataItemSeq;
+       if (msg_rsp != NULL) {
+               seq     = (DataItemSequence *)msg_rsp->_dataItemSeq;
+       }
+       else {
+               seq     = new DataItemSequence();
+       }
        rsp_seq_param._data     = seq;
 
        return 0;