From: Andre Noll Date: Sun, 9 Jul 2017 13:05:53 +0000 (+0200) Subject: aft: Make get_audio_file_path_of_row() more robust. X-Git-Tag: v0.6.1~24 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=b0be59e69290248c621510f1e6bc1406ee0ed823;ds=inline 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. --- 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; } /**