Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correctly free thread_data options at the topmost parent process #1603

Merged
merged 2 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -2494,10 +2494,7 @@ static void run_threads(struct sk_out *sk_out)
strerror(ret));
} else {
pid_t pid;
void *eo;
dprint(FD_PROCESS, "will fork\n");
eo = td->eo;
read_barrier();
pid = fork();
if (!pid) {
int ret;
Expand All @@ -2506,7 +2503,6 @@ static void run_threads(struct sk_out *sk_out)
_exit(ret);
} else if (__td_index == fio_debug_jobno)
*fio_debug_jobp = pid;
free(eo);
free(fd);
fd = NULL;
}
Expand Down
2 changes: 2 additions & 0 deletions cairo_text_helpers.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "cairo_text_helpers.h"

#include <cairo.h>
#include <gtk/gtk.h>
#include <math.h>
Expand Down
2 changes: 2 additions & 0 deletions cairo_text_helpers.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef CAIRO_TEXT_HELPERS_H
#define CAIRO_TEXT_HELPERS_H

#include <cairo.h>

void draw_centered_text(cairo_t *cr, const char *font, double x, double y,
double fontsize, const char *text);

Expand Down
2 changes: 2 additions & 0 deletions goptions.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef GFIO_OPTIONS_H
#define GFIO_OPTIONS_H

#include <gtk/gtk.h>

void gopt_get_options_window(GtkWidget *window, struct gfio_client *gc);
void gopt_init(void);
void gopt_exit(void);
Expand Down
3 changes: 2 additions & 1 deletion ioengines.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ void free_ioengine(struct thread_data *td)
if (td->eo && td->io_ops->options) {
options_free(td->io_ops->options, td->eo);
free(td->eo);
td->eo = NULL;
if (td->o.use_thread)
td->eo = NULL;
}

if (td->io_ops->dlhandle) {
Expand Down
2 changes: 2 additions & 0 deletions log.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "log.h"

#include <unistd.h>
#include <string.h>
#include <stdarg.h>
Expand Down
4 changes: 2 additions & 2 deletions options.c
Original file line number Diff line number Diff line change
Expand Up @@ -5829,9 +5829,9 @@ void fio_options_free(struct thread_data *td)
options_free(fio_options, &td->o);
if (td->eo && td->io_ops && td->io_ops->options) {
options_free(td->io_ops->options, td->eo);
free(td->eo);
td->eo = NULL;
}
free(td->eo);
td->eo = NULL;
}

void fio_dump_options_free(struct thread_data *td)
Expand Down
Loading