]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_registrar.c: Prevent potential double free if AOR is not found
authorSean Bright <sean.bright@gmail.com>
Wed, 4 Dec 2019 21:26:46 +0000 (16:26 -0500)
committerSean Bright <sean.bright@gmail.com>
Wed, 4 Dec 2019 22:17:57 +0000 (16:17 -0600)
commit1750847fc05eee9630eeea957658165021a6ad28
tree3cfa2e2855e9fa009dcd6c831d5c52f16c7d0159
parent890f8a79d4c68c0423e9289cd8140c0581ae387d
res_pjsip_registrar.c: Prevent potential double free if AOR is not found

The simple fix here is simply to NULL out username and password after we call
ast_free on them. Unfortunately, I noticed that we weren't checking for
allocation failures for username and password, and adding those checks made
things noisy and cumbersome.

So instead we partially rollback the recent LGTM patch, and move the alloca
calls into find_aor_name().

ASTERISK-28641 #close
Reported by: Ross Beer

Change-Id: Ic9d01624e717a020be0b0aee31f0814e7f1ffbe2
res/res_pjsip_registrar.c