Message ID | 20241018151300.445618-4-cgoettsche@seltendoof.de (mailing list archive) |
---|---|
State | Accepted |
Commit | cecbff935b6e |
Headers | show |
Series | [1/4] libselinux: avoid errno modification by fclose(3) | expand |
diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c index 40628e2c..b9c3be2a 100644 --- a/libselinux/src/label_file.c +++ b/libselinux/src/label_file.c @@ -563,8 +563,10 @@ static FILE *open_file(const char *path, const char *suffix, /* This handles the case if suffix is null */ path = rolling_append(stack_path, fdetails[i].suffix, sizeof(stack_path)); - if (!path) + if (!path) { + errno = ENOMEM; return NULL; + } rc = stat(path, &fdetails[i].sb); if (rc)