diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-27 03:09:41 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-27 03:57:10 +0000 |
| commit | 4599df64cab89b72cf679d07d936151d61fb37a8 (patch) | |
| tree | 8e415b95073033ee0c5e2ade7aa206942fff0072 /util/libreboot-utils/lib/file.c | |
| parent | 5d6344292a58aba54b321f6df2601630c26b62f9 (diff) | |
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib/file.c')
| -rw-r--r-- | util/libreboot-utils/lib/file.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/libreboot-utils/lib/file.c b/util/libreboot-utils/lib/file.c index 5fdef7b3..3ca50889 100644 --- a/util/libreboot-utils/lib/file.c +++ b/util/libreboot-utils/lib/file.c @@ -153,7 +153,7 @@ fsync_dir(const char *path) goto err_fsync_dir; } - free_if_null(&dirbuf); + free_and_set_null(&dirbuf); errno = saved_errno; return 0; @@ -163,7 +163,7 @@ err_fsync_dir: if (errno == saved_errno) errno = EIO; - free_if_null(&dirbuf); + free_and_set_null(&dirbuf); close_no_err(&dirfd); return -1; @@ -581,7 +581,7 @@ try_err(int loop_err, int errval) } void -free_if_null(char **buf) +free_and_set_null(char **buf) { if (buf == NULL || *buf == NULL) return; @@ -902,7 +902,7 @@ fs_dirname_basename(const char *path, *base = buf; } else { errno = EINVAL; - free_if_null(&buf); + free_and_set_null(&buf); return -1; } |
