@@ -244,7 +244,7 @@ parse_subscription_options(List *options, bool *connect, bool *enabled_given,
244
244
}
245
245
246
246
/*
247
- * Auxiliary function toreturn a text array out of a list of String nodes.
247
+ * Auxiliary function tobuild a text array out of a list of String nodes.
248
248
*/
249
249
static Datum
250
250
publicationListToArray (List * publist )
@@ -264,7 +264,8 @@ publicationListToArray(List *publist)
264
264
ALLOCSET_DEFAULT_MAXSIZE );
265
265
oldcxt = MemoryContextSwitchTo (memcxt );
266
266
267
- datums = palloc (sizeof (text * )* list_length (publist ));
267
+ datums = (Datum * )palloc (sizeof (Datum )* list_length (publist ));
268
+
268
269
foreach (cell ,publist )
269
270
{
270
271
char * name = strVal (lfirst (cell ));
@@ -275,7 +276,7 @@ publicationListToArray(List *publist)
275
276
{
276
277
char * pname = strVal (lfirst (pcell ));
277
278
278
- if (name == pname )
279
+ if (pcell == cell )
279
280
break ;
280
281
281
282
if (strcmp (name ,pname )== 0 )
@@ -292,6 +293,7 @@ publicationListToArray(List *publist)
292
293
293
294
arr = construct_array (datums ,list_length (publist ),
294
295
TEXTOID ,-1 , false,'i' );
296
+
295
297
MemoryContextDelete (memcxt );
296
298
297
299
return PointerGetDatum (arr );