-/* $Id: zebraapi.c,v 1.201 2006-02-09 08:31:02 adam Exp $
+/* $Id: zebraapi.c,v 1.203 2006-03-13 17:42:09 mike Exp $
Copyright (C) 1995-2005
Index Data ApS
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;
data1_set_tabroot (reg->dh, reg_path);
reg->recTypes = recTypes_init (zs->record_classes, reg->dh);
- reg->zebra_maps = zebra_maps_open (res, reg_path);
+ if ((reg->zebra_maps = zebra_maps_open (res, reg_path)) == 0) {
+ /* ### Do we need to destroy reg->recTypes? */
+ bfs_destroy(reg->bfs);
+ data1_destroy(reg->dh);
+ xfree(reg);
+ return 0;
+ }
+
reg->rank_classes = NULL;
reg->key_buf = 0;