comparison src/xs_length.c @ 472:3f02945a0c48

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 25 Jan 2007 05:58:05 +0000
parents d600f45c92d2
children c67a7f2fd586
comparison
equal deleted inserted replaced
471:1733f81f7480 472:3f02945a0c48
146 else 146 else
147 iOK = FALSE; 147 iOK = FALSE;
148 } 148 }
149 149
150 /* Allocate memory for lengths */ 150 /* Allocate memory for lengths */
151 tmpNode->sLengths = (gint *) g_malloc0(tmpNode->nLengths * sizeof(gint)); 151 if (tmpNode->nLengths > 0) {
152 if (!tmpNode->sLengths) { 152 tmpNode->sLengths = (gint *) g_malloc0(tmpNode->nLengths * sizeof(gint));
153 xs_error(_("Could not allocate memory for node.\n")); 153 if (!tmpNode->sLengths) {
154 xs_error(_("Could not allocate memory for node.\n"));
155 xs_sldb_node_free(tmpNode);
156 return NULL;
157 }
158 } else {
154 xs_sldb_node_free(tmpNode); 159 xs_sldb_node_free(tmpNode);
155 return NULL; 160 return NULL;
156 } 161 }
157 162
158 /* Read lengths in */ 163 /* Read lengths in */