From: Mike Taylor Date: Mon, 13 Mar 2006 17:42:09 +0000 (+0000) Subject: zebra_register_open() now fails if zebra_maps_open() returns a null pointer. X-Git-Tag: before.bug.529~214 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=4e48a2f759ac1e7224f00d7c091bb840885cf7d2;p=idzebra-moved-to-github.git zebra_register_open() now fails if zebra_maps_open() returns a null pointer. --- 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;