Fixed minor format errors and resource leaks

Some format strings used integer values for unsigned integers.
Memory and file descriptors leaked in some error conditions.
This commit is contained in:
Markus Makela
2015-11-25 10:40:16 +02:00
parent dcf0d4ef4b
commit 038877b8db
6 changed files with 7 additions and 6 deletions

View File

@ -1242,6 +1242,7 @@ createInstance(char **options, FILTER_PARAMETER **params)
if ((my_instance = calloc(1, sizeof(FW_INSTANCE))) == NULL ||
(my_instance->lock = (SPINLOCK*) malloc(sizeof(SPINLOCK))) == NULL)
{
free(my_instance);
MXS_ERROR("Memory allocation for firewall filter failed.");
return NULL;
}

View File

@ -199,7 +199,7 @@ int i,cflags = 0;
else
{
MXS_ERROR("lagfilter: unsupported option '%s'.",
options[i])));
options[i]);
}
}
}