Fixed memory leak and error while encrypting.

This commit is contained in:
Afonso Clerigo Mendes de Sousa 2025-02-27 12:26:01 +00:00
parent ec3082c527
commit 4b618b0be9

View File

@ -107,6 +107,7 @@ int main(void)
aux.level = -1; aux.level = -1;
send(connfd, &aux, sizeof(aux), 0); send(connfd, &aux, sizeof(aux), 0);
} }
free(filepath);
} }
else if (req.type == 1) else if (req.type == 1)
{ {
@ -117,8 +118,14 @@ int main(void)
sprintf(filepath, "%s%d.bin", filepath, req.level); sprintf(filepath, "%s%d.bin", filepath, req.level);
emcryptText(req.key, req.key); int *key2 = create(int);
writel(filepath, req.key, 256); key2 = size(key2, 256);
emcryptText(key2, req.key);
writel(filepath, key2, 256);
free(key2);
free(filepath);
} }
} }