@henningw commented on this pull request.
Thanks for the PR. I just added one remark related to the freeing of the previous
allocated memory in an error condition. Maybe others like to comment as well, as I do not
use this module a lot.
@@ -226,12 +230,22 @@ static inline int add_secret(str
_secret_key)
memset(secret_struct, 0, sizeof (struct secret));
secret_struct->secret_key = _secret_key;
SECRET_LOCK;
- if (secret_list != NULL)
+ if (secret_list == NULL)
+ {
+ secret_list = (struct secret **) shm_malloc(sizeof(struct secret *));
+ if (secret_list == NULL)
+ {
+ LM_ERR("unable to allocate shared memory\n");
+ return -1;
You probably want to free the previously allocated secret_struct
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3390#pullrequestreview-1333347409
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3390/review/1333347409(a)github.com>