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:
@ -298,6 +298,7 @@ char* admin_remove_user(
|
|||||||
fname,
|
fname,
|
||||||
err)));
|
err)));
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
fclose(fp_tmp);
|
||||||
unlink(fname_tmp);
|
unlink(fname_tmp);
|
||||||
return ADMIN_ERR_PWDFILEACCESS;
|
return ADMIN_ERR_PWDFILEACCESS;
|
||||||
}
|
}
|
||||||
@ -325,6 +326,7 @@ char* admin_remove_user(
|
|||||||
fname,
|
fname,
|
||||||
err)));
|
err)));
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
fclose(fp_tmp);
|
||||||
unlink(fname_tmp);
|
unlink(fname_tmp);
|
||||||
return ADMIN_ERR_PWDFILEACCESS;
|
return ADMIN_ERR_PWDFILEACCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -359,7 +359,7 @@ DOWNSTREAM *me;
|
|||||||
UPSTREAM *
|
UPSTREAM *
|
||||||
filterUpstream(FILTER_DEF *filter, void *fsession, UPSTREAM *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
|
* The the filter has no setUpstream entry point then is does
|
||||||
|
|||||||
@ -1008,7 +1008,7 @@ bool service_set_param_value (
|
|||||||
{
|
{
|
||||||
char* p;
|
char* p;
|
||||||
int valint;
|
int valint;
|
||||||
bool succp;
|
bool succp = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find out whether the value is numeric and ends with '%' or '\0'
|
* Find out whether the value is numeric and ends with '%' or '\0'
|
||||||
|
|||||||
Reference in New Issue
Block a user