diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-11-13 00:39:48 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-11-13 00:39:48 +0000 |
commit | 9b12ab6d5dd6c40ac112456c820a8dc199fc6e16 (patch) | |
tree | 9ee7a9977161f5343d4ffcf6b8c5453c963aae2e /src/backend/utils/adt/geo_ops.c | |
parent | aaa3a0caa6c3e4dacd950e2dc3c1691222c50965 (diff) |
Add new palloc0 call as merge of palloc and MemSet(0).
Diffstat (limited to 'src/backend/utils/adt/geo_ops.c')
-rw-r--r-- | src/backend/utils/adt/geo_ops.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index a0ddd377238..cf48c51d750 100644 --- a/src/backend/utils/adt/geo_ops.c +++ b/src/backend/utils/adt/geo_ops.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.70 2002/11/11 03:02:19 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.71 2002/11/13 00:39:47 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -3130,9 +3130,8 @@ poly_in(PG_FUNCTION_ARGS) elog(ERROR, "Bad polygon external representation '%s'", str); size = offsetof(POLYGON, p[0]) +sizeof(poly->p[0]) * npts; - poly = (POLYGON *) palloc(size); + poly = (POLYGON *) palloc0(size); /* zero any holes */ - MemSet((char *) poly, 0, size); /* zero any holes */ poly->size = size; poly->npts = npts; @@ -4452,9 +4451,7 @@ circle_poly(PG_FUNCTION_ARGS) if (base_size / npts != sizeof(poly->p[0]) || size <= base_size) elog(ERROR, "too many points requested"); - poly = (POLYGON *) palloc(size); - - MemSet(poly, 0, size); /* zero any holes */ + poly = (POLYGON *) palloc0(size); /* zero any holes */ poly->size = size; poly->npts = npts; |