[evolution] M!28 - e-contact-editor.c:file_as_get_style() avoid g_strdup+g_free call
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] M!28 - e-contact-editor.c:file_as_get_style() avoid g_strdup+g_free call
- Date: Tue, 9 Jul 2019 08:50:14 +0000 (UTC)
commit acc53a61696a0bd795fd464ff4dcfdd6f30ce70c
Author: Дилян Палаузов <git-dpa aegee org>
Date: Sun Jul 7 16:04:11 2019 +0000
M!28 - e-contact-editor.c:file_as_get_style() avoid g_strdup+g_free call
Closes https://gitlab.gnome.org/GNOME/evolution/merge_requests/28
src/addressbook/gui/contact-editor/e-contact-editor.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/addressbook/gui/contact-editor/e-contact-editor.c
b/src/addressbook/gui/contact-editor/e-contact-editor.c
index f61c317387..bc0cd8466f 100644
--- a/src/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/src/addressbook/gui/contact-editor/e-contact-editor.c
@@ -613,7 +613,7 @@ file_as_get_style (EContactEditor *editor)
e_builder_get_widget (editor->priv->builder, "combo-file-as"))));
GtkEntry *company_w = GTK_ENTRY (
e_builder_get_widget (editor->priv->builder, "entry-company"));
- gchar *filestring;
+ const gchar *filestring;
gchar *trystring;
EContactName *name = editor->priv->name;
const gchar *company;
@@ -623,18 +623,16 @@ file_as_get_style (EContactEditor *editor)
return -1;
company = gtk_entry_get_text (GTK_ENTRY (company_w));
- filestring = g_strdup (gtk_entry_get_text (file_as));
+ filestring = gtk_entry_get_text (file_as);
for (i = 0; i < 6; i++) {
trystring = name_to_style (name, company, i);
if (!strcmp (trystring, filestring)) {
g_free (trystring);
- g_free (filestring);
return i;
}
g_free (trystring);
}
- g_free (filestring);
return -1;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]