shishi-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS shishi/lib


From: shishi-commit
Subject: CVS shishi/lib
Date: Tue, 7 Feb 2006 13:44:25 +0100

Update of /home/cvs/shishi/lib
In directory dopio:/tmp/cvs-serv26653

Modified Files:
        authorize.c 
Log Message:
Don't free getpwnam return.


--- /home/cvs/shishi/lib/authorize.c    2005/05/26 15:12:34     1.9
+++ /home/cvs/shishi/lib/authorize.c    2006/02/07 12:44:25     1.10
@@ -1,5 +1,5 @@
 /* authorize.c --- Authorization to services of authenticated principals.
- * Copyright (C) 2003, 2004  Simon Josefsson
+ * Copyright (C) 2003, 2004, 2006  Simon Josefsson
  *
  * This file is part of Shishi.
  *
@@ -46,7 +46,7 @@
 
   pwd = getpwnam (authzname);
   if (pwd == NULL)
-    return authorized;
+    return 0;
 
   asprintf (&ficname, "%s%s", pwd->pw_dir, ".k5login");
 
@@ -58,17 +58,15 @@
   /* Owner should be user or root */
   if ((sta.st_uid != pwd->pw_uid) && (sta.st_uid != 0))
     {
-      free (pwd);
       free (ficname);
-      return authorized;
+      return 0;
     }
 
   fic = fopen (ficname, "r");
   if (fic == NULL)
     {
-      free (pwd);
       free (ficname);
-      return authorized;
+      return 0;
     }
 
   while (!feof (fic))
@@ -85,7 +83,6 @@
     }
 
   fclose (fic);
-  free (pwd);
   free (ficname);
   free (line);
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]