From: Mike Taylor Date: Wed, 26 Jul 2006 11:09:14 +0000 (+0000) Subject: Only pass schema back to caller if its non-zero-length. X-Git-Tag: release.1.0.3~8 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=6c0dd15aa32aa476938ed83a06c7259da791b887;p=simpleserver-moved-to-github.git Only pass schema back to caller if its non-zero-length. --- diff --git a/SimpleServer.xs b/SimpleServer.xs index b153429..93dbc4c 100644 --- a/SimpleServer.xs +++ b/SimpleServer.xs @@ -1,5 +1,5 @@ /* - * $Id: SimpleServer.xs,v 1.52 2006-07-26 01:08:44 mike Exp $ + * $Id: SimpleServer.xs,v 1.53 2006-07-26 11:09:14 mike Exp $ * ---------------------------------------------------------------------- * * Copyright (c) 2000-2004, Index Data. @@ -966,8 +966,10 @@ int bend_fetch(void *handle, bend_fetch_rr *rr) if (temp != 0) { schema = newSVsv(*temp); ptr = SvPV(schema, length); - rr->schema = (char *)odr_malloc(rr->stream, length + 1); - strcpy(rr->schema, ptr); + if (length > 0) { + rr->schema = (char *)odr_malloc(rr->stream, length + 1); + strcpy(rr->schema, ptr); + } } temp = hv_fetch(href, "HANDLE", 6, 1);