mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-04-20 10:51:48 +02:00
chcon: fix memory leak in error path
* src/chcon.c (change_file_context): If compute_context_from_mask fails, free the previously allocated file_context. Fixes https://bugs.gnu.org/79780
This commit is contained in:
@@ -168,7 +168,10 @@ change_file_context (int fd, char const *file)
|
||||
}
|
||||
|
||||
if (compute_context_from_mask (file_context, &context))
|
||||
return 1;
|
||||
{
|
||||
freecon (file_context);
|
||||
return 1;
|
||||
}
|
||||
|
||||
context_string = context_str (context);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user