diff options
author | the 34c3 gsm team <34c3-gsm@congress> | 2017-12-28 15:38:05 +0100 |
---|---|---|
committer | the 34c3 gsm team <34c3-gsm@congress> | 2017-12-28 15:38:05 +0100 |
commit | 63045a20691f6e5a5184b887b87aebabd86d68b6 (patch) | |
tree | 010432782f62c2d43fa71fb1f80a8e37a1f87641 | |
parent | 02dd4425a01b0fab069acfe3a2940d9e5e7fc085 (diff) |
smpp_smsc.c: don't talloc_strdup NULL pointers34c3
-rw-r--r-- | src/libmsc/smpp_smsc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 34b93f88f..d07165b09 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -971,10 +971,12 @@ struct smsc *smpp_smsc_alloc_init(void *ctx) /*! \brief Set the SMPP address and port without binding. */ int smpp_smsc_conf(struct smsc *smsc, const char *bind_addr, uint16_t port) { + const char *tmpaddr = bind_addr ? talloc_strdup(smsc, bind_addr) : NULL; + talloc_free((void*)smsc->bind_addr); smsc->bind_addr = NULL; if (bind_addr) { - smsc->bind_addr = talloc_strdup(smsc, bind_addr); + smsc->bind_addr = tmpaddr; if (!smsc->bind_addr) return -ENOMEM; } |