From 85e9e947eccc72ba0e9a0b5404a014e44bd2ec3d Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Wed, 4 Nov 2015 20:56:59 +0000 Subject: [PATCH] [QA] Coverity: Unchecked return value from library Explicitly ignore return values - when removing temporary generate files CID#131383 CID#131382 CID#131381 CID#34570 CID#34563 CID#34561 CID#34557 CID#34555 CID#34546 --- src/babel.c | 10 +++++----- src/bingmapsource.c | 2 +- src/datasource_geojson.c | 2 +- src/download.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/babel.c b/src/babel.c index 3f13ab37..64b89aac 100644 --- a/src/babel.c +++ b/src/babel.c @@ -317,7 +317,7 @@ gboolean a_babel_convert_from_filter( VikTrwLayer *vt, const char *babelargs, co g_strfreev(sub_filters); } else g_critical("gpsbabel not found in PATH"); - g_remove(name_dst); + (void)g_remove(name_dst); g_free(name_dst); } @@ -367,7 +367,7 @@ gboolean a_babel_convert_from_shellcommand ( VikTrwLayer *vt, const char *input_ ret = babel_general_convert_from ( vt, cb, args, name_dst, user_data ); g_free ( args ); g_free ( shell_command ); - g_remove(name_dst); + (void)g_remove(name_dst); g_free(name_dst); } @@ -407,7 +407,7 @@ gboolean a_babel_convert_from_url_filter ( VikTrwLayer *vt, const char *url, con if ((fd_src = g_file_open_tmp("tmp-viking.XXXXXX", &name_src, NULL)) >= 0) { g_debug ("%s: temporary file: %s", __FUNCTION__, name_src); close(fd_src); - g_remove(name_src); + (void)g_remove(name_src); fetch_ret = a_http_download_get_url(url, "", name_src, &myoptions, NULL); if (fetch_ret == DOWNLOAD_SUCCESS) { @@ -425,7 +425,7 @@ gboolean a_babel_convert_from_url_filter ( VikTrwLayer *vt, const char *url, con } } } - util_remove(name_src); + (void)util_remove(name_src); g_free(babelargs); g_free(name_src); } @@ -522,7 +522,7 @@ gboolean a_babel_convert_to( VikTrwLayer *vt, VikTrack *track, const char *babel g_strfreev(sub_args); } else g_critical("gpsbabel not found in PATH"); - g_remove(name_src); + (void)g_remove(name_src); g_free(name_src); } diff --git a/src/bingmapsource.c b/src/bingmapsource.c index 917d5302..17a083df 100644 --- a/src/bingmapsource.c +++ b/src/bingmapsource.c @@ -470,7 +470,7 @@ _load_attributions ( BingMapSource *self ) done: priv->loading_attributions = FALSE; g_free(uri); - g_remove(tmpname); + (void)g_remove(tmpname); g_free(tmpname); return ret; } diff --git a/src/datasource_geojson.c b/src/datasource_geojson.c index 054beb79..9d6fef1f 100644 --- a/src/datasource_geojson.c +++ b/src/datasource_geojson.c @@ -145,7 +145,7 @@ static gboolean datasource_geojson_process ( VikTrwLayer *vtl, ProcessOptions *p // Important that this process is run in the main thread vik_window_open_file ( adw->vw, gpx_filename, FALSE ); // Delete the temporary file - g_remove (gpx_filename); + (void)g_remove (gpx_filename); g_free (gpx_filename); } else { diff --git a/src/download.c b/src/download.c index e928a74b..9ded2f2e 100644 --- a/src/download.c +++ b/src/download.c @@ -375,7 +375,7 @@ static DownloadResult_t download( const char *hostname, const char *uri, const c } if (ret == CURL_DOWNLOAD_NO_NEWER_FILE) { - g_remove ( tmpfilename ); + (void)g_remove ( tmpfilename ); #if GLIB_CHECK_VERSION(2,18,0) g_utime ( fn, NULL ); /* update mtime of local copy */ #else @@ -447,7 +447,7 @@ gchar *a_download_uri_to_tmp_file ( const gchar *uri, DownloadMapOptions *option if ( curl_download_uri ( uri, tmp_file, options, NULL, NULL ) ) { // error fclose ( tmp_file ); - g_remove ( tmpname ); + (void)g_remove ( tmpname ); g_free ( tmpname ); return NULL; } -- 2.39.5