[evolution-ews/gnome-43] EwsConnect: Early stop a response traversal



commit 7af94ebe9967196c1845cc5c8126fbdebae657a7
Author: Milan Crha <mcrha redhat com>
Date:   Tue Oct 4 10:58:09 2022 +0200

    EwsConnect: Early stop a response traversal
    
    The 'subparam' variable is reused in an inner cycle, but the e_soap_parameter_get_next_child()
    doesn't support NULL as an argument, printing runtime warnings on the console,
    thus rather stop early the traversal.

 src/EWS/common/e-ews-connection.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/EWS/common/e-ews-connection.c b/src/EWS/common/e-ews-connection.c
index bf463d3d..95bd421f 100644
--- a/src/EWS/common/e-ews-connection.c
+++ b/src/EWS/common/e-ews-connection.c
@@ -4814,6 +4814,8 @@ e_ews_process_resolve_names_response (EEwsConnection *cnc,
                                        }
                                }
                        }
+
+                       break;
                }
 
                subparam = e_soap_parameter_get_next_child (subparam);
@@ -5119,14 +5121,16 @@ e_ews_process_expand_dl_response (EEwsConnection *cnc,
                        g_free (prop);
 
                        for (subparam = e_soap_parameter_get_first_child_by_name (subparam, "Mailbox");
-                               subparam != NULL;
-                               subparam = e_soap_parameter_get_next_child_by_name (subparam, "Mailbox")) {
+                            subparam != NULL;
+                            subparam = e_soap_parameter_get_next_child_by_name (subparam, "Mailbox")) {
                                EwsMailbox *mb;
 
                                mb = e_ews_item_mailbox_from_soap_param (subparam);
                                if (mb)
                                        *out_mailboxes = g_slist_prepend (*out_mailboxes, mb);
                        }
+
+                       break;
                }
 
                subparam = e_soap_parameter_get_next_child (subparam);


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