From: Sandro Santilli Date: Tue, 21 Dec 2004 11:25:10 +0000 (+0000) Subject: allocation for deserialized lwline made after type checking X-Git-Tag: pgis_1_0_0RC1~134 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9ae479a3ae1017d31dedd55026a542d35ba1940;p=postgis allocation for deserialized lwline made after type checking git-svn-id: http://svn.osgeo.org/postgis/trunk@1170 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/lwgeom/lwline.c b/lwgeom/lwline.c index f0ce27836..3227da6a4 100644 --- a/lwgeom/lwline.c +++ b/lwgeom/lwline.c @@ -42,10 +42,7 @@ lwline_deserialize(char *serialized_form) uint32 npoints; POINTARRAY *pa; - result = (LWLINE*) lwalloc(sizeof(LWLINE)) ; - type = (unsigned char) serialized_form[0]; - result->type = type; if ( lwgeom_getType(type) != LINETYPE) { @@ -53,6 +50,9 @@ lwline_deserialize(char *serialized_form) return NULL; } + result = (LWLINE*) lwalloc(sizeof(LWLINE)) ; + result->type = type; + loc = serialized_form+1; if (lwgeom_hasBBOX(type))