]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[apr] scan-build: fix dereference of null pointer in apr_hash_merge() and apr_proc_ot... 399/head
authorAndrey Volk <andywolk@gmail.com>
Thu, 20 Feb 2020 19:20:53 +0000 (23:20 +0400)
committerAndrey Volk <andywolk@gmail.com>
Thu, 20 Feb 2020 19:20:53 +0000 (23:20 +0400)
libs/apr/misc/unix/otherchild.c
libs/apr/tables/apr_hash.c

index 427a57e7e475b6653c26bbf1432b3f000487a306..c97cfdd6446045423a9adc2da7660bf2a20bded2 100644 (file)
@@ -96,7 +96,7 @@ APR_DECLARE(void) apr_proc_other_child_unregister(void *data)
     }
 
     /* segfault if this function called with invalid parm */
-    apr_pool_cleanup_kill(cur->p, cur->data, other_child_cleanup);
+    if (cur) apr_pool_cleanup_kill(cur->p, cur->data, other_child_cleanup);
     other_child_cleanup(data);
 }
 
index 4e3723e19f111f3c25af8564b986b6e1e63ce248..5cac297af96723b1689c50f3ba67acadb2663433 100644 (file)
@@ -459,7 +459,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p,
                     break;
                 }
             }
-            if (!ent) {
+            if (new_vals && !ent) {
                 new_vals[j].klen = iter->klen;
                 new_vals[j].key = iter->key;
                 new_vals[j].val = iter->val;