Skip to content
Snippets Groups Projects
Commit bea7394e authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Detect smb_[f]allocdat() failures in qnetmail()

CID 319140
parent 087508b4
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -1378,6 +1378,15 @@ bool sbbs_t::qnetmail(const char *into, const char *subj, long mode, smb_t* resm
offset=smb_allocdat(&smb,length,1);
smb_close_da(&smb);
if(offset < 0) {
smb_freemsgdat(&smb,offset,length,1);
smb_unlocksmbhdr(&smb);
smb_close(&smb);
smb_stack(&smb,SMB_STACK_POP);
errormsg(WHERE,ERR_ALLOC,msgpath,length);
return(false);
}
if((instream=fnopen(&file,msgpath,O_RDONLY|O_BINARY))==NULL) {
smb_freemsgdat(&smb,offset,length,1);
smb_unlocksmbhdr(&smb);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment