From: Andy Green Date: Sat, 15 Jul 2017 09:50:24 +0000 (+0800) Subject: valgrind: fix leak in caps handling X-Git-Tag: upstream/2.3.0~49 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=81d5899c89f578b7b6c8d9d30aae04ccc2e64f08;p=platform%2Fupstream%2Flibwebsockets.git valgrind: fix leak in caps handling --- diff --git a/lib/lws-plat-unix.c b/lib/lws-plat-unix.c index a2284f44..07b7edc8 100644 --- a/lib/lws-plat-unix.c +++ b/lib/lws-plat-unix.c @@ -294,11 +294,13 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, int fd) static void _lws_plat_apply_caps(int mode, cap_value_t *cv, int count) { - cap_t caps = cap_get_proc(); + cap_t caps; if (!count) return; + caps = cap_get_proc(); + cap_set_flag(caps, mode, count, cv, CAP_SET); cap_set_proc(caps); prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);