]> git.tue.mpg.de Git - paraslash.git/commitdiff
afs: Free status items on exit.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 3 Jan 2018 00:01:42 +0000 (01:01 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 13 Mar 2018 02:28:57 +0000 (03:28 +0100)
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
afs.h
aft.c

diff --git a/afs.c b/afs.c
index 75a4b97dac5eb8a9a351d71c0ac61fb7b839ee77..e82e7726363216a99a5630b47a0e9ef66d784bb3 100644 (file)
--- 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 f506cbff1076842df7d3924d02aaee1ec97ec1bc..0bdd76d0f6d8be82c7a0cdb1579c94d7622fb44b 100644 (file)
--- 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 b863f22ab9cfd4eed97ac59da1277f26196f8f23..f9512c7a8ba8111220c73b8ef931d8a49f6efde1 100644 (file)
--- 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);