Forgot the error handling "throw".

This commit is contained in:
Afonso Clerigo Mendes de Sousa 2025-02-27 13:17:43 +00:00
parent a566c264aa
commit 7b1875c2b6

View File

@ -141,6 +141,10 @@ int main(void)
{ {
sendKEY = create(char); sendKEY = create(char);
sendKEY = size(send, 256); sendKEY = size(send, 256);
if (sendKEY == NULL)
{
throw(MEMORY_ALLOC_FAILURE);
}
} }
catch (MEMORY_ALLOC_FAILURE) catch (MEMORY_ALLOC_FAILURE)
{ {
@ -148,11 +152,12 @@ int main(void)
close(sockfd); close(sockfd);
return 1; return 1;
} }
end_try;
decryptText(sendKEY, buffer); decryptText(sendKEY, buffer);
aux.ID = req.ID; aux.ID = req.ID;
memccpy(aux.key, send, 0, 256); memccpy(aux.key, sendKEY, 0, 256);
aux.level = req.level; aux.level = req.level;
aux.type = req.type; aux.type = req.type;
send(connfd, &aux, sizeof(aux), 0); send(connfd, &aux, sizeof(aux), 0);