Fixed memory leak and error while encrypting.
This commit is contained in:
parent
ec3082c527
commit
4b618b0be9
11
src/server.c
11
src/server.c
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user