Review at  https://gerrit.osmocom.org/7512

gsup_test_client: gsupc_read_cb: fix uninitialized value 'io'

Change-Id: Idb3ca50009e25c8e10bcbd15e430caf6de18a040
---
M src/libgsupclient/gsup_test_client.c
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/12/7512/1

diff --git a/src/libgsupclient/gsup_test_client.c 
b/src/libgsupclient/gsup_test_client.c
index add98e4..03ba68e 100644
--- a/src/libgsupclient/gsup_test_client.c
+++ b/src/libgsupclient/gsup_test_client.c
@@ -217,7 +217,7 @@
 static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg)
 {
        struct osmo_gsup_message gsup_msg = {0};
-       struct imsi_op *io;
+       struct imsi_op *io = NULL;
        int rc;
 
        DEBUGP(DLGSUP, "Rx GSUP %s\n", msgb_hexdump(msg));
@@ -237,14 +237,14 @@
        case IMSI_OP_SAI:
        case IMSI_OP_LU:
                io = imsi_op_find(gsup_msg.imsi, rc);
-               if (!io)
-                       return -1;
                break;
        case IMSI_OP_ISD:
                /* ISD is an inbound transaction */
                io = imsi_op_alloc(g_gc, gsup_msg.imsi, IMSI_OP_ISD);
                break;
        }
+       if (!io)
+               return -1;
 
        imsi_op_rx_gsup(io, &gsup_msg);
        msgb_free(msg);

-- 
To view, visit https://gerrit.osmocom.org/7512
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb3ca50009e25c8e10bcbd15e430caf6de18a040
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofm...@sysmocom.de>

Reply via email to