patch from upstream for prompting problem when no tty associated with sudo
[debian/sudo] / alias.c
diff --git a/alias.c b/alias.c
index e8fec56c07e59dfda2b28f3ab6ffc3e261882022..b1f57e7ecafb45a12ec1ff119dd3643e9c5f0d45 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004-2005m, 2007-2009
+ * Copyright (c) 2004-2005, 2007-2010
  *     Todd C. Miller <Todd.Miller@courtesan.com>
  *
  * Permission to use, copy, modify, and distribute this software for any
 #endif /* STDC_HEADERS */
 #ifdef HAVE_STRING_H
 # include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-#  include <strings.h>
-# endif
+#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
 #endif /* HAVE_STRING_H */
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #include "redblack.h"
 #include <gram.h>
 
-#ifndef lint
-__unused static const char rcsid[] = "$Sudo: alias.c,v 1.18 2009/05/25 12:02:41 millert Exp $";
-#endif /* lint */
-
 /*
  * Globals
  */
@@ -125,8 +120,8 @@ alias_add(name, type, members)
     a->seqno = 0;
     list2tq(&a->members, members);
     if (rbinsert(aliases, a)) {
-       alias_free(a);
        snprintf(errbuf, sizeof(errbuf), "Alias `%s' already defined", name);
+       alias_free(a);
        return(errbuf);
     }
     return(NULL);