terminate fix for piler-smtp

Change-Id: I07592f4bc68549a0bdae155b8bff4035bdb213dd
Signed-off-by: SJ <sj@acts.hu>
This commit is contained in:
SJ 2016-12-22 10:46:11 +01:00
parent 96625883bb
commit 7c3d659194

View File

@ -46,11 +46,14 @@ void p_clean_exit(){
if(listenerfd != -1) close(listenerfd); if(listenerfd != -1) close(listenerfd);
for(i=0; i<cfg.max_connections; i++){ if(sessions){
if(sessions[i]) free_smtp_session(sessions[i]); for(i=0; i<cfg.max_connections; i++){
if(sessions[i]) free_smtp_session(sessions[i]);
}
free(sessions);
} }
if(sessions) free(sessions);
if(events) free(events); if(events) free(events);
syslog(LOG_PRIORITY, "%s has been terminated", PROGNAME); syslog(LOG_PRIORITY, "%s has been terminated", PROGNAME);