X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=apps%2Fopenssl.c;h=d0937156766773662dac7bc667c8b1e15719842e;hp=0e179d9c339152a6eb669e9ce454360fe71d1c8a;hb=0e2cc42cfb4d09c19140f89853e3f0cf4d8c5142;hpb=16e819e1d8916aab302625c065aba567cc403f41 diff --git a/apps/openssl.c b/apps/openssl.c index 0e179d9c33..d093715676 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ /* ==================================================================== - * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -114,6 +114,7 @@ #include #include #define OPENSSL_C /* tells apps.h to use complete apps_startup() */ +#include "apps.h" #include #include #include @@ -121,8 +122,8 @@ #include #include #include +#include #define USE_SOCKETS /* needed for the _O_BINARY defs in the MS world */ -#include "apps.h" #include "progs.h" #include "s_apps.h" #include @@ -138,11 +139,11 @@ static unsigned long MS_CALLBACK hash(const void *a_void); static int MS_CALLBACK cmp(const void *a_void,const void *b_void); static LHASH *prog_init(void ); static int do_cmd(LHASH *prog,int argc,char *argv[]); -CONF *config=NULL; char *default_config_file=NULL; /* Make sure there is only one when MONOLITH is defined */ #ifdef MONOLITH +CONF *config=NULL; BIO *bio_err=NULL; #endif @@ -214,8 +215,8 @@ static void lock_dbg_cb(int mode, int type, const char *file, int line) int main(int Argc, char *Argv[]) { ARGS arg; -#define PROG_NAME_SIZE 16 - char pname[PROG_NAME_SIZE]; +#define PROG_NAME_SIZE 39 + char pname[PROG_NAME_SIZE+1]; FUNCTION f,*fp; MS_STATIC char *prompt,buf[1024],config_name[256]; int n,i,ret=0; @@ -273,7 +274,12 @@ int main(int Argc, char *Argv[]) config=NCONF_new(NULL); i=NCONF_load(config,p,&errline); - if (i == 0) ERR_clear_error(); + if (i == 0) + { + NCONF_free(config); + config = NULL; + ERR_clear_error(); + } prog=prog_init();