fixed potential use after free in openpgpsdk

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8491 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
electron128 2015-06-16 14:09:34 +00:00
parent 4b624a6091
commit 779ebbf925

View File

@ -1116,11 +1116,15 @@ ops_boolean_t ops_sign_file_as_cleartext(const char* input_filename,
&& ops_signature_hashed_subpackets_end(sig)
&& ops_write_signature(sig, &skey->public_key, skey, cinfo);
ops_teardown_file_write(cinfo, fd_out);
if (!rtn)
OPS_ERROR(&cinfo->errors, OPS_E_W, "Cannot sign file as cleartext");
// we can't get errors in cinfo->errors while closing
// because ops_teardown_file_write frees everything
// it seems that writer finalisers do not report errors anyway
// and ops_teardown_file_write does not have an return value, so we could not bubble something up
ops_teardown_file_write(cinfo, fd_out);
return rtn;
}