Skip to content

Commit

Permalink
5763 missing va_end() on return from __fini_daemon_priv()
Browse files Browse the repository at this point in the history
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Marcel Telka <marcel@telka.sk>
Approved by: Richard Lowe <richlowe@richlowe.net>
  • Loading branch information
jgmills authored and richlowe committed May 1, 2015
1 parent d17b05b commit 75598e1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions usr/src/lib/libc/port/gen/privlib.c
Expand Up @@ -20,6 +20,7 @@
*/

/*
* Copyright 2015 Gary Mills
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*/

Expand Down Expand Up @@ -571,10 +572,12 @@ __fini_daemon_priv(const char *priv, ...)
priv_set_t *nset;
va_list pa;

va_start(pa, priv);

if (priv != NULL) {

va_start(pa, priv);
nset = priv_vlist(pa);
va_end(pa);

if (nset == NULL)
return;

Expand All @@ -583,8 +586,6 @@ __fini_daemon_priv(const char *priv, ...)
priv_freeset(nset);
}

va_end(pa);

(void) setpflags(__PROC_PROTECT, 0);
}

Expand Down

0 comments on commit 75598e1

Please sign in to comment.