1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-23 02:13:01 +01:00

Fix memory leak

This commit is contained in:
Jfreegman 2016-06-29 21:36:54 -04:00
parent 9fcbc3bde0
commit 9f74d3a3a8
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63

View File

@ -634,6 +634,8 @@ int store_data(Tox *m, const char *path)
free(enc_data); free(enc_data);
return -1; return -1;
} }
free(enc_data);
} else { /* data will not be encrypted */ } else { /* data will not be encrypted */
if (fwrite(data, data_len, 1, fp) != 1) { if (fwrite(data, data_len, 1, fp) != 1) {
fprintf(stderr, "Failed to write profile data.\n"); fprintf(stderr, "Failed to write profile data.\n");