Skip to content

Commit

Permalink
Merge branch 'do-caps-memory-leak' of https://github.com/maks-mishin/…
Browse files Browse the repository at this point in the history
…util-linux

* 'do-caps-memory-leak' of https://github.com/maks-mishin/util-linux:
  sys-utils: (setpriv): fix potential memory leak
karelzak committed Dec 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 4a36750 + 480682e commit 9a5bd4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sys-utils/setpriv.c
Original file line number Diff line number Diff line change
@@ -542,6 +542,7 @@ static int cap_update(capng_act_t action,
static void do_caps(enum cap_type type, const char *caps)
{
char *my_caps = xstrdup(caps);
char *source_my_caps = my_caps;
char *c;

while ((c = strsep(&my_caps, ","))) {
@@ -572,7 +573,7 @@ static void do_caps(enum cap_type type, const char *caps)
}
}

free(my_caps);
free(source_my_caps);
}

static void parse_securebits(struct privctx *opts, const char *arg)

0 comments on commit 9a5bd4a

Please sign in to comment.