From 4e48a2f759ac1e7224f00d7c091bb840885cf7d2 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Mon, 13 Mar 2006 17:42:09 +0000 Subject: [PATCH] zebra_register_open() now fails if zebra_maps_open() returns a null pointer. --- index/zebraapi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/index/zebraapi.c b/index/zebraapi.c index dc26b11..cb05bb6 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.202 2006-02-21 15:23:11 adam Exp $ +/* $Id: zebraapi.c,v 1.203 2006-03-13 17:42:09 mike Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -328,7 +328,14 @@ struct zebra_register *zebra_register_open(ZebraService zs, const char *name, 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; -- 1.7.10.4