From 958b4b6c54d1539a9e6683d3148a742c41760433 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 3 Jan 2018 01:01:42 +0100 Subject: [PATCH] afs: Free status items on exit. The server process frees the memory allocated for the status items on exit but the afs process does not. To avoid the leak we have to make free_status_items() public. --- afs.c | 1 + afs.h | 1 + aft.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/afs.c b/afs.c index 75a4b97d..e82e7726 100644 --- a/afs.c +++ b/afs.c @@ -1008,6 +1008,7 @@ out_close: close_afs_tables(); out: signal_shutdown(signal_task); + free_status_items(); free_lpr(); if (ret < 0) PARA_EMERG_LOG("%s\n", para_strerror(-ret)); diff --git a/afs.h b/afs.h index f506cbff..0bdd76d0 100644 --- a/afs.h +++ b/afs.h @@ -254,6 +254,7 @@ int get_afhi_of_row(const struct osl_row *row, struct afh_info *afhi); int get_audio_file_path_of_row(const struct osl_row *row, char **path); int audio_file_loop(void *private_data, osl_rbtree_loop_func *func); int aft_check_callback(struct afs_callback_arg *aca); +void free_status_items(void); /* playlist */ int playlist_open(const char *name); diff --git a/aft.c b/aft.c index b863f22a..f9512c7a 100644 --- a/aft.c +++ b/aft.c @@ -978,7 +978,7 @@ out: WRITE_STATUS_ITEM(pb, SI_file_size, "%ld\n", statbuf.st_size / 1024); } -static void free_status_items(void) +void free_status_items(void) { freep(&status_items); freep(&parser_friendly_status_items); -- 2.39.2