diff --git a/src/inputs/pipe.c b/src/inputs/pipe.c index b3196d54..71e19dd2 100644 --- a/src/inputs/pipe.c +++ b/src/inputs/pipe.c @@ -322,7 +322,8 @@ pict_tmpfile_recreate(struct pipe_metadata *pm, const char *ext) pict_tmpfile_close(pm); strcpy(pm->pict_tmpfile_path, PIPE_TMPFILE_TEMPLATE); - strncpy(pm->pict_tmpfile_path + offset, ext, PIPE_TMPFILE_TEMPLATE_EXTLEN); + // Use memcpy instead of strncpy because gcc 8 gives false warnings otherwise + memcpy(pm->pict_tmpfile_path + offset, ext, PIPE_TMPFILE_TEMPLATE_EXTLEN); pm->pict_tmpfile_fd = mkstemps(pm->pict_tmpfile_path, PIPE_TMPFILE_TEMPLATE_EXTLEN); diff --git a/src/library/filescanner_itunes.c b/src/library/filescanner_itunes.c index d0fab8cf..4a3a7cc6 100644 --- a/src/library/filescanner_itunes.c +++ b/src/library/filescanner_itunes.c @@ -391,6 +391,7 @@ mfi_id_find(const char *path) { if (qp.results == 1) { + free(winner); // This is just here to keep scan-build happy winner = strdup(dbpath); break; } diff --git a/src/library/filescanner_playlist.c b/src/library/filescanner_playlist.c index f195c31d..554523e7 100644 --- a/src/library/filescanner_playlist.c +++ b/src/library/filescanner_playlist.c @@ -159,6 +159,7 @@ process_regular_file(int pl_id, char *path) { if (qp.results == 1) { + free(winner); // This is just here to keep scan-build happy winner = strdup(dbpath); break; }