Commit 76e3859d authored by deuce's avatar deuce
Browse files

"If you alloc() in a DLL, thou shalt free() in the same DLL"

-- Albert Einstein
parent c94649ef
......@@ -298,7 +298,7 @@ static int ftp_close_socket(SOCKET* sock, CRYPT_SESSION *sess, int line)
get_crypt_error_string(status, session, &estr, action, &GCES_level);\
if (estr) { \
lprintf(GCES_level, "%04d %s", sock, estr); \
free(estr); \
free_crypt_attrstr(estr); \
} \
} while (0)
......@@ -1935,7 +1935,7 @@ static BOOL start_tls(SOCKET *sock, CRYPT_SESSION *sess, BOOL resp)
if (get_ssl_cert(&scfg, &estr, &level) == -1) {
if (estr) {
lprintf(level, "%04d FTP %s", estr);
free(estr);
free_crypt_attrstr(estr);
}
if (resp)
sockprintf(*sock, *sess, "431 TLS not available");
......
......@@ -68,7 +68,7 @@ static int do_cryptAttribute(const CRYPT_CONTEXT session, CRYPT_ATTRIBUTE_TYPE a
get_crypt_error_string(ret, session, &estr, "setting attribute", &level);
if (estr) {
lprintf(level, "%s", estr);
free(estr);
free_crypt_attrstr(estr);
}
}
return ret;
......@@ -84,7 +84,7 @@ static int do_cryptAttributeString(const CRYPT_CONTEXT session, CRYPT_ATTRIBUTE_
get_crypt_error_string(ret, session, &estr, "setting attribute string", &level);
if (estr) {
lprintf(level, "%s", estr);
free(estr);
free_crypt_attrstr(estr);
}
}
return ret;
......@@ -95,7 +95,7 @@ static int do_cryptAttributeString(const CRYPT_CONTEXT session, CRYPT_ATTRIBUTE_
get_crypt_error_string(status, pdata->session, &estr, "flushing data", &GCES_level); \
if (estr) { \
lprintf(GCES_level, "%04d %s", p->sock, estr); \
free(estr); \
free_crypt_attrstr(estr); \
} \
} while(0)
......@@ -104,7 +104,7 @@ static int do_cryptAttributeString(const CRYPT_CONTEXT session, CRYPT_ATTRIBUTE_
get_crypt_error_string(status, handle, &estr, "flushing data", &GCESH_level); \
if (estr) { \
lprintf(GCESH_level, "%04d %s", socket, estr); \
free(estr); \
free_crypt_attrstr(estr); \
} \
} while(0)
......@@ -1772,7 +1772,7 @@ static JSBool js_socket_set(JSContext *cx, JSObject *obj, jsid id, JSBool strict
if (get_ssl_cert(scfg, &estr, &level) == -1) {
if (estr) {
lprintf(level, "%04d %s", p->sock, estr);
free(estr);
free_crypt_attrstr(estr);
}
}
if (scfg->tls_certificate == -1)
......
......@@ -150,7 +150,7 @@ typedef struct {
get_crypt_error_string(status, sess, &GCES_estr, "flushing data", &GCES_level); \
if (GCES_estr) { \
lprintf(GCES_level, "%04d %s%s", sock, server, GCES_estr); \
free(GCES_estr); \
free_crypt_attrstr(GCES_estr); \
} \
} while(0)
......@@ -160,7 +160,7 @@ typedef struct {
get_crypt_error_string(status, sess, &GCES_estr, "flushing data", &GCES_level); \
if (GCES_estr) { \
lprintf(GCES_level, "%04d %s [%s] %s", sock, server, host, GCES_estr); \
free(GCES_estr); \
free_crypt_attrstr(GCES_estr); \
} \
} while(0)
......@@ -992,7 +992,7 @@ static void pop3_thread(void* arg)
if (get_ssl_cert(&scfg, &estr, &level) == -1) {
if (estr) {
lprintf(level, "%04d !POP3 [%s] %s", socket, host_ip);
free(estr);
free_crypt_attrstr(estr);
}
mail_close_socket(socket);
thread_down();
......@@ -2793,7 +2793,7 @@ static void smtp_thread(void* arg)
if (get_ssl_cert(&scfg, &estr, &level) == -1) {
if (estr) {
lprintf(level, "%04d !SMTP %s", socket, estr);
free(estr);
free_crypt_attrstr(estr);
}
mail_close_socket(socket);
thread_down();
......@@ -4694,7 +4694,7 @@ static void smtp_thread(void* arg)
if (get_ssl_cert(&scfg, &estr, &level) == -1) {
if (estr) {
lprintf(level, "%04d !SMTP %s", socket, estr);
free(estr);
free_crypt_attrstr(estr);
}
sockprintf(socket, session, "454 TLS not available");
continue;
......
......@@ -115,7 +115,7 @@ int thread_suid_broken=TRUE; /* NPTL is no longer broken */
get_crypt_error_string(status, sess, &GCES_estr, action, &GCES_level); \
if (GCES_estr) { \
lprintf(GCES_level, "Node %d SSH %s", node, GCES_estr); \
free(GCES_estr); \
free_crypt_attrstr(GCES_estr); \
} \
} while (0)
......@@ -125,7 +125,7 @@ int thread_suid_broken=TRUE; /* NPTL is no longer broken */
get_crypt_error_string(status, sess, &GCES_estr, action, &GCES_level); \
if (GCES_estr) { \
lprintf(GCES_level, "SSH %s", GCES_estr); \
free(GCES_estr); \
free_crypt_attrstr(GCES_estr); \
} \
} while (0)
......@@ -135,7 +135,7 @@ int thread_suid_broken=TRUE; /* NPTL is no longer broken */
get_crypt_error_string(status, sess, &GCES_estr, action, &GCES_level); \
if (GCES_estr) { \
lprintf(GCES_level, "%04d SSH %s", sock, GCES_estr); \
free(GCES_estr); \
free_crypt_attrstr(GCES_estr); \
} \
} while (0)
......
......@@ -944,7 +944,7 @@ static BOOL handle_crypt_call(int status, service_client_t *service_client, cons
get_crypt_error_string(status, sess, &estr, action, &level);
if (estr) {
lprintf(level, "%04d %s", sock, estr);
free(estr);
free_crypt_attrstr(estr);
}
}
}
......@@ -1917,7 +1917,7 @@ void DLLCALL services_thread(void* arg)
if (get_ssl_cert(&scfg, &ssl_estr, &level) == -1) {
if (ssl_estr) {
lprintf(level, "No TLS certificiate %s", ssl_estr);
free(ssl_estr);
free_crypt_attrstr(ssl_estr);
}
}
}
......
......@@ -371,7 +371,7 @@ void postmsg(char type, char* to, char* to_number, char* to_address,
}
smb_freemsgmem(&msg);
fprintf(statfp, "Message (%u bytes) added to %s successfully\n", strlen(msgtxt), smb.file);
fprintf(statfp, "Message (%u bytes) added to %s successfully\n", strlen((char *)msgtxt), smb.file);
FREE_AND_NULL(msgtxt);
}
......
......@@ -400,7 +400,7 @@ enum {
get_crypt_error_string(status, sess->tls_sess, &GCES_estr, action, &GCES_level);\
if (GCES_estr) { \
lprintf(GCES_level, "%04d %s", sess->socket, GCES_estr); \
free(GCES_estr); \
free_crypt_attrstr(GCES_estr); \
} \
} while (0)
......@@ -6789,7 +6789,7 @@ void DLLCALL web_server(void* arg)
if (get_ssl_cert(&scfg, &ssl_estr, &lvl) == -1) {
if (ssl_estr) {
lprintf(lvl, "%s", ssl_estr);
free(ssl_estr);
free_crypt_attrstr(ssl_estr);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment