From b0be59e69290248c621510f1e6bc1406ee0ed823 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 9 Jul 2017 15:05:53 +0200 Subject: [PATCH] aft: Make get_audio_file_path_of_row() more robust. On errors we used to leave the path pointer uninitialized. This commit sets it to NULL in this case. --- aft.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aft.c b/aft.c index 63a40d79..7a6d3f22 100644 --- a/aft.c +++ b/aft.c @@ -542,10 +542,12 @@ int get_audio_file_path_of_row(const struct osl_row *row, char **path) struct osl_object path_obj; int ret = osl(osl_get_object(audio_file_table, row, AFTCOL_PATH, &path_obj)); + if (ret < 0) - return ret; - *path = path_obj.data; - return 1; + *path = NULL; + else + *path = path_obj.data; + return ret; } /** -- 2.39.2