Fixed soem errors from a cppcheck run

mbrampton@martin-office:~/Dropbox/development/skygit/MaxScale/server$ cppcheck -q core/*.c
[core/adminusers.c:302]: (error) Resource leak: fp_tmp
[core/filter.c:382]: (error) Uninitialized variable: me
[core/service.c:1071]: (error) Uninitialized variable: succp
This commit is contained in:
Mark Riddoch 2014-08-22 14:25:27 +01:00
parent 40c2846887
commit 3476558f52
3 changed files with 4 additions and 2 deletions

View File

@ -298,6 +298,7 @@ char* admin_remove_user(
fname,
err)));
fclose(fp);
fclose(fp_tmp);
unlink(fname_tmp);
return ADMIN_ERR_PWDFILEACCESS;
}
@ -325,6 +326,7 @@ char* admin_remove_user(
fname,
err)));
fclose(fp);
fclose(fp_tmp);
unlink(fname_tmp);
return ADMIN_ERR_PWDFILEACCESS;
}

View File

@ -359,7 +359,7 @@ DOWNSTREAM *me;
UPSTREAM *
filterUpstream(FILTER_DEF *filter, void *fsession, UPSTREAM *upstream)
{
UPSTREAM *me;
UPSTREAM *me = NULL;
/*
* The the filter has no setUpstream entry point then is does

View File

@ -1008,7 +1008,7 @@ bool service_set_param_value (
{
char* p;
int valint;
bool succp;
bool succp = true;
/**
* Find out whether the value is numeric and ends with '%' or '\0'