client: fix potential NULL dereference
[fio.git] / client.c
index 6b9fdd8dbfb8e784a9205bcd4c7ff99d97ae3ae1..edc02a0a13416c04fbb546bf2c05799a440bbf84 100644 (file)
--- a/client.c
+++ b/client.c
@@ -271,6 +271,9 @@ int fio_client_add_ini_file(void *cookie, const char *ini_file, int remote)
        size_t new_size;
        void *new_files;
 
        size_t new_size;
        void *new_files;
 
+       if (!client)
+               return 1;
+
        dprint(FD_NET, "client <%s>: add ini %s\n", client->hostname, ini_file);
 
        new_size = (client->nr_files + 1) * sizeof(struct client_file);
        dprint(FD_NET, "client <%s>: add ini %s\n", client->hostname, ini_file);
 
        new_size = (client->nr_files + 1) * sizeof(struct client_file);