core: Don't leak memory if error is unknown
authorErwan Velu <erwan@enovance.com>
Mon, 22 Jul 2013 21:46:10 +0000 (23:46 +0200)
committerErwan Velu <erwan@enovance.com>
Mon, 22 Jul 2013 21:47:05 +0000 (23:47 +0200)
If error is unknown, the "return 1" call was not freeing error which was
malloced at the beginning of the function.

options.c

index 6462c67c3a92ff7c1a966ef90e33b8814219928f..1c44f426dcbde350f6bff5479e31aeee37b7702f 100644 (file)
--- a/options.c
+++ b/options.c
@@ -271,6 +271,7 @@ static int ignore_error_type(struct thread_data *td, int etype, char *str)
                if (!error[i]) {
                        log_err("Unknown error %s, please use number value \n",
                                  fname);
                if (!error[i]) {
                        log_err("Unknown error %s, please use number value \n",
                                  fname);
+                       free(error);
                        return 1;
                }
                i++;
                        return 1;
                }
                i++;