crypto_rsa.c: CID 1439488: Resource leaks
Coverity report from 18th Sept: ``` /src/lib/crypt_ops/crypto_rsa.c: 558 in crypto_pk_read_private_key_from_filename() 552 { 553 struct stat st; 554 char *buf = read_file_to_str(keyfile, 0, &st); 555 if (!buf) 556 return -1; 557 if (st.st_size > MAX_PRIVKEY_FILE_LEN) >>> CID 1439488: Resource leaks (RESOURCE_LEAK) >>> Variable "buf" going out of scope leaks the storage it points to. 558 return -1; 559 560 int rv = crypto_pk_read_private_key_from_string(env, buf, 561 (ssize_t)st.st_size); 562 memwipe(buf, 0, (size_t)st.st_size); 563 tor_free(buf); ```
issue