Module: kamailio
Branch: master
Commit: 11831568d9eaef233fe6e482ad2c63788b04bbd9
URL: 
https://github.com/kamailio/kamailio/commit/11831568d9eaef233fe6e482ad2c63788b04bbd9

Author: Pantelis Kolatsis <[email protected]>
Committer: Henning Westerholt <[email protected]>
Date: 2023-04-29T19:16:32Z

crypto: convert to memory error logging helper

---

Modified: src/modules/crypto/crypto_aes.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/11831568d9eaef233fe6e482ad2c63788b04bbd9.diff
Patch: 
https://github.com/kamailio/kamailio/commit/11831568d9eaef233fe6e482ad2c63788b04bbd9.patch

---

diff --git a/src/modules/crypto/crypto_aes.c b/src/modules/crypto/crypto_aes.c
index 37cdd6844a..f5728a6e42 100644
--- a/src/modules/crypto/crypto_aes.c
+++ b/src/modules/crypto/crypto_aes.c
@@ -25,6 +25,7 @@
 #include <string.h>
 
 #include "../../core/dprint.h"
+#include "../../core/mem/pkg.h"
 
 #include "crypto_aes.h"
 
@@ -139,7 +140,7 @@ unsigned char *crypto_aes_encrypt(EVP_CIPHER_CTX *e, 
unsigned char *plaintext,
        unsigned char *ciphertext = (unsigned char *)malloc(c_len);
 
        if(ciphertext == NULL) {
-               LM_ERR("no more system memory\n");
+               SYS_MEM_ERROR;
                return NULL;
        }
        /* allows reusing of 'e' for multiple encryption cycles */
@@ -179,7 +180,7 @@ unsigned char *crypto_aes_decrypt(EVP_CIPHER_CTX *e, 
unsigned char *ciphertext,
        unsigned char *plaintext = (unsigned char *)malloc(p_len);
 
        if(plaintext==NULL) {
-               LM_ERR("no more system memory\n");
+               SYS_MEM_ERROR;
                return NULL;
        }
        if(!EVP_DecryptInit_ex(e, NULL, NULL, NULL, NULL)){

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to [email protected]

Reply via email to