X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzebraapi.c;h=dc26b11463a08999b3b75606649a3300ee079e95;hb=67f1321cbac10c08079a589eb8a948796aa90779;hp=8207926fef7bfd31d84f8d66fc69035a32eb984a;hpb=1d09966e51904c44ed82eaa920ffc9fbcc087541;p=idzebra-moved-to-github.git diff --git a/index/zebraapi.c b/index/zebraapi.c index 8207926..dc26b11 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.201 2006-02-09 08:31:02 adam Exp $ +/* $Id: zebraapi.c,v 1.202 2006-02-21 15:23:11 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -184,11 +184,18 @@ ZebraService zebra_start_res (const char *configName, Res def_res, Res over_res) const char *passwd_plain = 0; const char *passwd_encrypt = 0; const char *dbaccess = 0; - ZebraService zh = xmalloc(sizeof(*zh)); + ZebraService zh = 0; if (configName) - res_read_file(res, configName); - + { + ZEBRA_RES ret = res_read_file(res, configName); + if (ret != ZEBRA_OK) + { + res_close(res); + return 0; + } + } + zh = xmalloc(sizeof(*zh)); zh->global_res = res; zh->sessions = 0;