talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 21d44076177d8cb5755b020a8e0fb8f1f183da05
parent a3050f1d0ba4c5a31ac873b1cc3067dd77002705
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Wed,  8 Mar 2017 12:07:51 +0100

Added debug output for failure cases in sgpgme_data_release_and_get_mem()

Diffstat:
Msrc/plugins/pgpcore/sgpgme.c | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c @@ -1126,10 +1126,8 @@ void *sgpgme_data_release_and_get_mem(gpgme_data_t data, size_t *len) ssize_t r = 0; size_t w = 0; - if (data == NULL) - return NULL; - if (len == NULL) - return NULL; + cm_return_val_if_fail(data != NULL, NULL); + cm_return_val_if_fail(len != NULL, NULL); /* I know it's deprecated, but we don't compile with _LARGEFILE */ cm_gpgme_data_rewind(data); @@ -1150,6 +1148,7 @@ void *sgpgme_data_release_and_get_mem(gpgme_data_t data, size_t *len) gpgme_data_release(data); if (r < 0) { + g_warning("gpgme_data_read() returned an error: %d", (int)r); free(result); *len = 0; return NULL;