]> 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:18:24 +0000 (16:18 -0600)
commit68ce999351105fea32bb4ff22e01d2ec4603045f
tree03850b3466fa0d3ec1577e4264ff5987164d03d3
parent5c20cc4c3aa0684ff2a81513c85165718ca09d87
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