Fix leaks with using get_opt_postfix()
It returns a strdup(), so remember to free() the result when done.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/options.c b/options.c
index f068ebd..3d27f25 100644
--- a/options.c
+++ b/options.c
@@ -154,8 +154,10 @@
char *nr = get_opt_postfix(str);
td->o.ddir_nr = 1;
- if (nr)
+ if (nr) {
td->o.ddir_nr = atoi(nr);
+ free(nr);
+ }
return 0;
}
@@ -285,8 +287,10 @@
char *nr = get_opt_postfix(str);
td->file_service_nr = 1;
- if (nr)
+ if (nr) {
td->file_service_nr = atoi(nr);
+ free(nr);
+ }
return 0;
}
@@ -426,8 +430,10 @@
char *nr = get_opt_postfix(str);
td->o.lockfile_batch = 1;
- if (nr)
+ if (nr) {
td->o.lockfile_batch = atoi(nr);
+ free(nr);
+ }
return 0;
}