Module: sip-router
Branch: master
Commit: 7ca703c25a24b38a95c3493aae4ae0be3820b881
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7ca703c…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Thu Apr 8 19:47:35 2010 +0300
modules_k/permissions: fixed incorrect error message
- Error message "no more shm memory" was generated by init_addresses
function also when the error was not related to shared memory.
---
modules_k/permissions/address.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/modules_k/permissions/address.c b/modules_k/permissions/address.c
index bc27be2..469e21a 100644
--- a/modules_k/permissions/address.c
+++ b/modules_k/permissions/address.c
@@ -219,7 +219,10 @@ int init_addresses(void)
addr_hash_table = (struct addr_list ***)shm_malloc
(sizeof(struct addr_list **));
- if (!addr_hash_table) goto error;
+ if (!addr_hash_table) {
+ LM_ERR("no more shm memory for addr_hash_table\n");
+ goto error;
+ }
*addr_hash_table = addr_hash_table_1;
@@ -230,7 +233,10 @@ int init_addresses(void)
if (!subnet_table_2) goto error;
subnet_table = (struct subnet **)shm_malloc(sizeof(struct subnet *));
- if (!subnet_table) goto error;
+ if (!subnet_table) {
+ LM_ERR("no more shm memory for subnet_table\n");
+ goto error;
+ }
*subnet_table = subnet_table_1;
@@ -245,7 +251,6 @@ int init_addresses(void)
return 0;
error:
- LM_ERR("no more shm memory\n");
if (addr_hash_table_1) {
free_addr_hash_table(addr_hash_table_1);
addr_hash_table_1 = 0;