Memory leak in SMTP Client string trim
authorHarlow Solutions <citadel@harlowsolutions.com>
Tue, 18 Jul 2023 20:05:04 +0000 (16:05 -0400)
committerHarlow Solutions <citadel@harlowsolutions.com>
Tue, 18 Jul 2023 20:05:04 +0000 (16:05 -0400)
serv_smtpclient.c: Removed unused variable 't' from trim_response() which was malloc'ing memory

citadel/server/modules/smtp/serv_smtpclient.c

index 9a91dc164e7c3fe1586c48f29d253d374045a9c3..5bbc77d1720007e582d8efc3423b5c34691cbd55 100644 (file)
@@ -167,12 +167,6 @@ void trim_response(long response_code, char *response) {
                return;
        }
 
-       char *t = malloc(strlen(response));
-       if (!t) {
-               return;
-       }
-       t[0] = 0;
-
        char *p;
        for (p = response; *p != 0; ++p) {
                if ( (*p != '\n') && (!isprint(*p)) ) {         // expunge any nonprintables except for newlines