]> granicus.if.org Git - sudo/commitdiff
Check sudoers_initlocale return value and treat as oom.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 12 Aug 2016 12:00:17 +0000 (06:00 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 12 Aug 2016 12:00:17 +0000 (06:00 -0600)
Coverity CID 141832

plugins/sudoers/defaults.c

index ee7776df312460de49d9dcc28da82d3ffacc6654..cd3bd31597ba1426898d19c4ec5083139a54ce35 100644 (file)
@@ -639,8 +639,10 @@ init_defaults(void)
     def_pam_setcred = true;
 
     /* Reset the locale. */
-    if (!firsttime)
-       sudoers_initlocale(NULL, def_sudoers_locale);
+    if (!firsttime) {
+       if (!sudoers_initlocale(NULL, def_sudoers_locale))
+           goto oom;
+    }
 
     /* Finally do the lists (currently just environment tables). */
     if (!init_envtables())