Avoid one strdup in address_completion_complete_address_in_entry().
authorAndrej Kacian <ticho@claws-mail.org>
Sun, 16 Jul 2017 18:04:57 +0000 (20:04 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Sun, 16 Jul 2017 18:04:57 +0000 (20:04 +0200)
src/addr_compl.c

index 8b4296e..9cf536a 100644 (file)
@@ -1430,9 +1430,10 @@ static gboolean address_completion_complete_address_in_entry(GtkEntry *entry,
        else 
 #endif
        if( ncount == 0 ) {
-               addrcompl_add_queue( g_strdup( searchTerm ) );
+               addrcompl_add_queue( searchTerm );
+       } else {
+               g_free( searchTerm );
        }
-       g_free( searchTerm );
 
        return TRUE;
 }