Code

options: removed NULL checks before g_free()
authorMax Kellermann <max@duempel.org>
Fri, 14 Aug 2009 21:44:06 +0000 (23:44 +0200)
committerMax Kellermann <max@duempel.org>
Fri, 14 Aug 2009 21:44:06 +0000 (23:44 +0200)
g_free() handles NULL parameters well.

src/options.c

index 5d8b1fda448cac033905d64a5ff602a94c6926be..c4540d38f25f17b42859b94c1e1bd2279ed97738 100644 (file)
@@ -251,23 +251,19 @@ handle_option(int c, const char *arg)
                options.port = atoi(arg);
                break;
        case 'h': /* --host */
-               if( options.host )
-                       g_free(options.host);
+               g_free(options.host);
                options.host = g_strdup(arg);
                break;
        case 'P': /* --password */
-               if( options.password )
-                       g_free(options.password);
+               g_free(options.password);
                options.password = locale_to_utf8(arg);
                break;
        case 'f': /* --config */
-               if( options.config_file )
-                       g_free(options.config_file);
+               g_free(options.config_file);
                options.config_file = g_strdup(arg);
                break;
        case 'k': /* --key-file */
-               if( options.key_file )
-                       g_free(options.key_file);
+               g_free(options.key_file);
                options.key_file = g_strdup(arg);
                break;
        case 'S': /* --key-file */