]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
dn was computed after it was needed.
authorKurt Zeilenga <kurt@openldap.org>
Sun, 25 Oct 1998 16:48:16 +0000 (16:48 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 25 Oct 1998 16:48:16 +0000 (16:48 +0000)
clients/gopher/go500gw.c
clients/gopher/setproctitle.c

index 7f74fbf57c562e78dca41c33a5e9f4ac11a5c798..6d1ed89bf16b1dbca212a4b5864a38f93442acec 100644 (file)
@@ -10,9 +10,6 @@
  * is provided ``as is'' without express or implied warranty.
  */
 
-#include "lber.h"
-#include "ldap.h"
-#include "disptmpl.h"
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
 #ifdef aix
 #include <sys/select.h>
 #endif /* aix */
-#include "portable.h"
-#include "ldapconfig.h"
 
 #ifdef USE_SYSCONF
 #include <unistd.h>
 #endif /* USE_SYSCONF */
 
+#include "lber.h"
+#include "ldap.h"
+#include "disptmpl.h"
+
+#include "portable.h"
+#include "ldapconfig.h"
+
 int    debug;
 int    dosyslog;
 int    inetd;
@@ -156,6 +158,14 @@ char       **argv;
        dtblsize = getdtablesize();
 #endif /* USE_SYSCONF */
 
+#ifdef FD_SETSIZE
+       if ( dtblsize > FD_SETSIZE ) {
+               dtblsize = FD_SETSIZE;
+       }
+#endif /* FD_SETSIZE*/
+
+
+
 #ifdef GO500GW_HOSTNAME
        strcpy( myhost, GO500GW_HOSTNAME );
 #else
@@ -766,15 +776,16 @@ char      *query;
 
                e = ldap_first_entry( ld, res );
                oc = ldap_get_values( ld, e, "objectClass" );
-               if ( isnonleaf( ld, oc, dn ) ) {
-                       dn = ldap_get_dn( ld, e );
+               dn = ldap_get_dn( ld, e );
 
+               if ( isnonleaf( ld, oc, dn ) ) {
                        rc = do_menu( ld, fp, dn );
 
                        free( dn );
                        return( rc );
                }
 
+               free( dn );
                ldap_value_free( oc );
        }
 
index 26b42c0ceede62f7bc1e854bfef26a1f0a6aa34e..c7f832604d7c4371e1a73a981286870ee232163b 100644 (file)
@@ -21,6 +21,7 @@ int   Argc;           /* original argc */
 /* VARARGS */
 setproctitle( fmt, a, b, c )
 char *fmt;
+char *a, *b, *c;
 {
        static char *endargv = (char *)0;
        char    *s;