Skip to content

Commit

Permalink
kernel: add release function
Browse files Browse the repository at this point in the history
Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 authored and edsiper committed Sep 19, 2023
1 parent 64b70ed commit d792434
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/fluent-bit/flb_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ struct flb_kernel {
};

struct flb_kernel *flb_kernel_info();
void flb_kernel_destroy(struct flb_kernel *kernel);

#endif
12 changes: 12 additions & 0 deletions src/flb_kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,15 @@ struct flb_kernel *flb_kernel_info()
}

#endif

void flb_kernel_destroy(struct flb_kernel *kernel)
{
if (kernel == NULL) {
return;
}

if (kernel->s_version.data) {
flb_free(kernel->s_version.data);
}
flb_free(kernel);
}

0 comments on commit d792434

Please sign in to comment.