From: Lennart Poettering Date: Thu, 6 Nov 2025 08:32:56 +0000 (+0100) Subject: pull-job: optionally free userdata when we destroy a PullJob X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98b714e0cbece762bda82a19d0c034909bfc6a2b;p=thirdparty%2Fsystemd.git pull-job: optionally free userdata when we destroy a PullJob --- diff --git a/src/import/pull-job.c b/src/import/pull-job.c index bd421180424..ef1da55af04 100644 --- a/src/import/pull-job.c +++ b/src/import/pull-job.c @@ -62,6 +62,9 @@ PullJob* pull_job_unref(PullJob *j) { iovec_done(&j->expected_checksum); free(j->content_type); + if (j->free_userdata) + j->free_userdata(j->userdata); + return mfree(j); } diff --git a/src/import/pull-job.h b/src/import/pull-job.h index 41dc5674285..08051846003 100644 --- a/src/import/pull-job.h +++ b/src/import/pull-job.h @@ -36,6 +36,8 @@ typedef struct PullJob { char *url; void *userdata; + free_func_t free_userdata; + PullJobFinished on_finished; PullJobOpenDisk on_open_disk; PullJobHeader on_header;