1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-07-01 15:47:46 +02:00

QR: close file descriptor on error

This commit is contained in:
Ansa89 2016-10-06 11:54:27 +02:00
parent 6bc5d8c543
commit 71040355fd
No known key found for this signature in database
GPG Key ID: 19B3DFBF159E800E

View File

@ -54,8 +54,10 @@ int ID_to_QRcode_txt(const char *tox_id, const char *outfile)
QRcode *qr_obj = QRcode_encodeString(tox_id, 0, QR_ECLEVEL_L, QR_MODE_8, 0);
if (qr_obj == NULL)
if (qr_obj == NULL) {
fclose(fp);
return -1;
}
size_t width = qr_obj->width;
size_t i, j;