Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Mar 10, 2022

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit a24ef2702e2c1b948df37080eb3f18cca60d414b:

Merge branch 'master' of https://github.com/dpronin/fio (2022-03-08 16:42:37 -0700)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to df0ab55ff9e28f4b85c199e207aec904f8a76440:

Merge branch 'master' of https://github.com/dpronin/fio (2022-03-09 06:20:31 -0700)

----------------------------------------------------------------
Denis Pronin (3):
- freeing job_sections array of strings upon freeing each its item in init.c
- fixed memory leak, which is happening when parsing options, claimed by ASAN
- fixed memory leak in parent process detected by ASAN when forking and not freeing memory in the parent process allocated for fork_data

Jens Axboe (3):
Merge branch 'fix/asan-memleak' of https://github.com/dpronin/fio
Merge branch 'fix/asan-memleak-forkdata' of https://github.com/dpronin/fio
Merge branch 'master' of https://github.com/dpronin/fio

 backend.c | 2 ++
 init.c    | 4 ++++
 parse.c   | 2 ++
 3 files changed, 8 insertions(+)

---

Diff of recent changes:

backend.c +2 -0
index a21dfef6..cd7f4e5f 100644
@@ -2441,6 +2441,8 @@ reap:
 					_exit(ret);
 				} else if (i == fio_debug_jobno)
 					*fio_debug_jobp = pid;
+				free(fd);
+				fd = NULL;
 			}
 			dprint(FD_MUTEX, "wait on startup_sem\n");
 			if (fio_sem_down_timeout(startup_sem, 10000)) {
init.c +4 -0
index 81c30f8c..b7f866e6 100644
@@ -2185,6 +2185,10 @@ static int __parse_jobs_ini(struct thread_data *td,
 		i++;
 	}
 
+	free(job_sections);
+	job_sections = NULL;
+	nr_job_sections = 0;
+
 	free(opts);
 out:
 	free(string);
parse.c +2 -0
index d086ee48..e0bee004 100644
@@ -817,6 +817,8 @@ store_option_value:
 
 		if (o->off1) {
 			cp = td_var(data, o, o->off1);
+			if (*cp)
+				free(*cp);
 			*cp = strdup(ptr);
 			if (strlen(ptr) > o->maxlen - 1) {
 				log_err("value exceeds max length of %d\n",