smpp_smsc.c: don't talloc_strdup NULL pointers
This commit is contained in:
parent
02dd4425a0
commit
63045a2069
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue