From 6c0dd15aa32aa476938ed83a06c7259da791b887 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 26 Jul 2006 11:09:14 +0000 Subject: [PATCH] Only pass schema back to caller if its non-zero-length. --- SimpleServer.xs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); -- 1.7.10.4