diff options
Diffstat (limited to 'plugin/firewall')
| -rw-r--r-- | plugin/firewall/eurephiafw.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugin/firewall/eurephiafw.c b/plugin/firewall/eurephiafw.c index 0ee83de..10d48a7 100644 --- a/plugin/firewall/eurephiafw.c +++ b/plugin/firewall/eurephiafw.c @@ -38,6 +38,7 @@ #include <sys/mman.h> #include <sys/wait.h> #include <time.h> +#include <assert.h> #define EUREPHIA_FWINTF #include <eurephiafw_struct.h> @@ -139,12 +140,11 @@ void eFW_StartFirewall(eurephiaCTX *ctx) { char buf[1026], *fwdest = NULL; unsigned int prio; - ctx->fwcfg = (eurephiaFWINTF *) malloc(sizeof(eurephiaFWINTF)+2); - memset(ctx->fwcfg, 0, sizeof(eurephiaFWINTF)+2); + ctx->fwcfg = (eurephiaFWINTF *) malloc_nullsafe(ctx, sizeof(eurephiaFWINTF)+2); // Create a fake eurephia context, just for logging - shadowctx = (eurephiaCTX *) malloc(sizeof(eurephiaCTX)+2); - memset(shadowctx, 0, sizeof(eurephiaCTX)+2); + shadowctx = (eurephiaCTX *) malloc_nullsafe(ctx, sizeof(eurephiaCTX)+2); + assert( shadowctx != NULL ); shadowctx->context_type = ECTX_NO_PRIVILEGES; shadowctx->loglevel = ctx->loglevel; shadowctx->log = ctx->log; |
