[evolution-mapi/wip/mcrha/eds-libical-glib] Fix an issue found by Coverity Scan



commit dfe42cfaa0f75c31600d58e1534dc916be331764
Author: Milan Crha <mcrha redhat com>
Date:   Thu Apr 25 15:38:35 2019 +0200

    Fix an issue found by Coverity Scan

 src/collection/e-mapi-backend.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/collection/e-mapi-backend.c b/src/collection/e-mapi-backend.c
index 53d4c84..d4a357d 100644
--- a/src/collection/e-mapi-backend.c
+++ b/src/collection/e-mapi-backend.c
@@ -893,10 +893,17 @@ mapi_backend_authenticate_sync (EBackend *backend,
 
                if (res == E_SOURCE_AUTHENTICATION_ERROR) {
                        if (krb_error) {
-                               GError *new_error = g_error_new (mapi_error->domain, mapi_error->code,
-                                       /* Translators: the first '%s' is replaced with a generic error 
message,
-                                          the second '%s' is replaced with additional error information. */
-                                       C_("gssapi_error", "%s (%s)"), mapi_error->message, 
krb_error->message);
+                               GError *new_error;
+
+                               if (mapi_error) {
+                                       new_error = g_error_new (mapi_error->domain, mapi_error->code,
+                                               /* Translators: the first '%s' is replaced with a generic 
error message,
+                                                  the second '%s' is replaced with additional error 
information. */
+                                               C_("gssapi_error", "%s (%s)"), mapi_error->message, 
krb_error->message);
+                               } else {
+                                       new_error = g_error_copy (krb_error);
+                               }
+
                                g_clear_error (&mapi_error);
                                mapi_error = new_error;
                        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]