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 8b4296e8de0e52b9b1faa8bd7d971d10901d4fd2..9cf536a78ebfa6c63fd32de8e8a357a43249c871 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;
 }