mirror of
https://github.com/systemd/systemd.git
synced 2026-11-07 22:07:14 +00:00
mute-console: refuse multiple requests per connection
Otherwise, that triggers memory leak and multiple free on the same object.
This commit is contained in:
1 parent
54253d2a9c
commit
112e4fe00a
1 file changed
+4
@@ -236,6 +236,10 @@ static int vl_method_mute(
|
||||
assert(link);
|
||||
assert(FLAGS_SET(flags, SD_VARLINK_METHOD_MORE));
|
||||
|
||||
/* Refuse multiple requests per connection. */
|
||||
if (sd_varlink_get_userdata(link))
|
||||
return -EBUSY;
|
||||
|
||||
_cleanup_free_ Context *nc = new(Context, 1);
|
||||
if (!nc)
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in new issue
Block a user