From: Christian Kruse Date: Tue, 22 Apr 2014 08:55:55 +0000 (+0200) Subject: bdr: fix: use palloc0() instead of palloc() X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=baadc63e70eeaff98147e3263129df3c83785e07;p=users%2Fandresfreund%2Fpostgres.git bdr: fix: use palloc0() instead of palloc() When using palloc(), bdr_startup_context->workers is not NULL/NIL and therefore the later lcons() call will lead to a segfault. --- diff --git a/contrib/bdr/bdr.c b/contrib/bdr/bdr.c index 355d20e4d4..501700fe78 100644 --- a/contrib/bdr/bdr.c +++ b/contrib/bdr/bdr.c @@ -1359,7 +1359,7 @@ _PG_init(void) bdr_worker_alloc_shmem_segment(); /* Prepare storage to pass data into our shared memory startup hook */ - bdr_startup_context = (BdrStartupContext *) palloc(sizeof(BdrStartupContext)); + bdr_startup_context = (BdrStartupContext *) palloc0(sizeof(BdrStartupContext)); /* Names of all databases we're going to be doing BDR for */ used_databases = palloc0(sizeof(char *) * list_length(connames));