mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
lib: Ignore a bunch of bogus GCC 11 warnings.
-Werror=analyzer-file-leak doesn't follow CLEANUP_FCLOSE properly.
yara.c:64:24: error: leak of FILE '<unknown>' [CWE-775] [-Werror=analyzer-file-leak]
64 | CLEANUP_FCLOSE FILE *fp = NULL;
| ^~
This commit is contained in:
@@ -71,6 +71,8 @@ guestfs_impl_find_inode (guestfs_h *g, const char *mountable, int64_t inode)
|
||||
return parse_dirent_file (g, tmpfile); /* caller frees */
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wanalyzer-file-leak"
|
||||
/* Parse the file content and return dirents list.
|
||||
* Return a list of tsk_dirent on success, NULL on error.
|
||||
*/
|
||||
@@ -101,6 +103,7 @@ parse_dirent_file (guestfs_h *g, const char *tmpfile)
|
||||
|
||||
return dirents;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/* Deserialise the file content and populate the dirent list.
|
||||
* Return the number of deserialised dirents, -1 on error.
|
||||
|
||||
@@ -54,6 +54,8 @@ guestfs_impl_yara_scan (guestfs_h *g, const char *path)
|
||||
return parse_yara_detection_file (g, tmpfile); /* caller frees */
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wanalyzer-file-leak"
|
||||
/* Parse the file content and return detections list.
|
||||
* Return a list of yara_detection on success, NULL on error.
|
||||
*/
|
||||
@@ -86,6 +88,7 @@ parse_yara_detection_file (guestfs_h *g, const char *tmpfile)
|
||||
|
||||
return detections;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/* Deserialise the file content and populate the detection list.
|
||||
* Return the number of deserialised detections, -1 on error.
|
||||
|
||||
Reference in New Issue
Block a user