[evolution-data-server] M!27 - e-book-backend-ldap.c:func_exists() avoid strdup+free



commit 3326ebee37f09bd411fb7d9f7830232c4af9e538
Author: Дилян Палаузов <git-dpa aegee org>
Date:   Fri Jul 19 09:59:02 2019 +0000

    M!27 - e-book-backend-ldap.c:func_exists() avoid strdup+free
    
    Closes https://gitlab.gnome.org/GNOME/evolution-data-server/merge_requests/27

 src/addressbook/backends/ldap/e-book-backend-ldap.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
---
diff --git a/src/addressbook/backends/ldap/e-book-backend-ldap.c 
b/src/addressbook/backends/ldap/e-book-backend-ldap.c
index 7b82e646b..9ea955b83 100644
--- a/src/addressbook/backends/ldap/e-book-backend-ldap.c
+++ b/src/addressbook/backends/ldap/e-book-backend-ldap.c
@@ -3845,9 +3845,6 @@ func_exists (struct _ESExp *f,
                if (!strcmp (propname, "x-evolution-any-field")) {
                        gint i;
                        GString *big_query;
-                       gchar *match_str;
-
-                       match_str = g_strdup ("=*)");
 
                        big_query = g_string_sized_new (G_N_ELEMENTS (prop_info) * 7);
                        g_string_append (big_query, "(|");
@@ -3859,14 +3856,12 @@ func_exists (struct _ESExp *f,
                                     !(prop_info[i].prop_type & PROP_CALENTRY))) {
                                        g_string_append_c (big_query, '(');
                                        g_string_append (big_query, prop_info[i].ldap_attr);
-                                       g_string_append (big_query, match_str);
+                                       g_string_append_len (big_query, "=*)", 3);
                                }
                        }
                        g_string_append_c (big_query, ')');
 
                        ldap_data->list = g_list_prepend (ldap_data->list, g_string_free (big_query, FALSE));
-
-                       g_free (match_str);
                }
                else {
                        const gchar *ldap_attr = query_prop_to_ldap (propname, 
ldap_data->bl->priv->evolutionPersonSupported, ldap_data->bl->priv->calEntrySupported);


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