don't use freed data
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4172 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -221,22 +221,24 @@ int krb4_enc(char *msg)
|
|||||||
}
|
}
|
||||||
kerror = krb_rd_priv(cmd, len, schedule, &auth_dat.session,
|
kerror = krb_rd_priv(cmd, len, schedule, &auth_dat.session,
|
||||||
&his_addr, &ctrl_addr, &m_data);
|
&his_addr, &ctrl_addr, &m_data);
|
||||||
free(cmd);
|
|
||||||
|
|
||||||
if(kerror){
|
if(kerror){
|
||||||
reply(535, "Error reading request: %s.", krb_get_err_text(kerror));
|
reply(535, "Error reading request: %s.", krb_get_err_text(kerror));
|
||||||
|
free(cmd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = malloc(strlen(msg) + 1);
|
tmp = malloc(strlen(msg) + 1);
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
reply(451, "Failed to allocate memory.");
|
reply(451, "Failed to allocate memory.");
|
||||||
|
free(cmd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
snprintf(tmp, strlen(msg) + 1, "%.*s", (int)m_data.app_length, m_data.app_data);
|
snprintf(tmp, strlen(msg) + 1, "%.*s", (int)m_data.app_length, m_data.app_data);
|
||||||
if(!strstr(tmp, "\r\n"))
|
if(!strstr(tmp, "\r\n"))
|
||||||
strcat(tmp, "\r\n");
|
strcat(tmp, "\r\n");
|
||||||
new_ftp_command(tmp);
|
new_ftp_command(tmp);
|
||||||
|
free(cmd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user