Add missing check for malloc failure in plpgsql_extra_checks_check_hook().
authorTom Lane
Mon, 20 Jun 2016 19:36:54 +0000 (15:36 -0400)
committerTom Lane
Mon, 20 Jun 2016 19:37:12 +0000 (15:37 -0400)
Per report from Andreas Seltenreich.  Back-patch to affected versions.

Report: <[email protected]>

src/pl/plpgsql/src/pl_handler.c

index f5238d6cadc2e72c465fa5e68af0f014f0294791..e831733fa4a187daee207d7f7baec802968c72a3 100644 (file)
@@ -108,6 +108,8 @@ plpgsql_extra_checks_check_hook(char **newvalue, void **extra, GucSource source)
    }
 
    myextra = (int *) malloc(sizeof(int));
+   if (!myextra)
+       return false;
    *myextra = extrachecks;
    *extra = (void *) myextra;