aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r--channels/chan_zap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index bdc786fa9..556cdc59c 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -7163,8 +7163,10 @@ static void *do_monitor(void *data)
/* Lock the interface list */
ast_mutex_lock(&iflock);
if (!pfds || (lastalloc != ifcount)) {
- if (pfds)
+ if (pfds) {
ast_free(pfds);
+ pfds = NULL;
+ }
if (ifcount) {
if (!(pfds = ast_calloc(1, ifcount * sizeof(*pfds)))) {
ast_mutex_unlock(&iflock);