Remove unused variables
Correct some (non important) memory leaks
Remove fclose(NULL)
Correct possible out of bound access
spotted with cppcheck
Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39994
3c298f89-4303-0410-b956-
a3cf2f4a3e73
#ifdef PACKET_RECV_TYPE
struct sockaddr_ll sll;
struct ifreq ifr;
#ifdef PACKET_RECV_TYPE
struct sockaddr_ll sll;
struct ifreq ifr;
- int ifindex, mask;
- int fd, ret;
fd = pcap_get_selectable_fd(p);
if (fd < 0)
fd = pcap_get_selectable_fd(p);
if (fd < 0)
- ret = setsockopt(fd, SOL_PACKET, PACKET_RECV_TYPE, &mask, sizeof(mask));
+ setsockopt(fd, SOL_PACKET, PACKET_RECV_TYPE, &mask, sizeof(mask));
check_bridge_port(const char *br, const char *port, void *arg)
{
struct ead_instance *in;
check_bridge_port(const char *br, const char *port, void *arg)
{
struct ead_instance *in;
- struct list_head *p, *tmp;
list_for_each(p, &instances) {
in = list_entry(p, struct ead_instance, list);
list_for_each(p, &instances) {
in = list_entry(p, struct ead_instance, list);
{
#ifdef linux
struct ead_instance *in;
{
#ifdef linux
struct ead_instance *in;
- struct list_head *p, *tmp;
br_foreach_bridge(check_bridge, NULL);
br_foreach_bridge(check_bridge, NULL);
#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
int i;
#endif
#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
int i;
#endif
-#ifdef BN_RECURSION
- BIGNUM *t;
- int j,k;
-#endif
#ifdef BN_COUNT
printf("BN_mul %d * %d\n",a->top,b->top);
#ifdef BN_COUNT
printf("BN_mul %d * %d\n",a->top,b->top);
int index;
struct t_client * tc;
struct t_preconf *tcp;
int index;
struct t_client * tc;
struct t_preconf *tcp;
- struct t_num n;
- struct t_num g;
struct t_num s;
struct t_num B;
char username[MAXUSERLEN];
struct t_num s;
struct t_num B;
char username[MAXUSERLEN];
int i, validated;
struct t_preconf * tpc;
int i, validated;
struct t_preconf * tpc;
- BigInteger nn, gg, n12, r;
-
validated = 0;
if(n->len < MIN_MOD_BYTES)
return 0;
validated = 0;
if(n->len < MIN_MOD_BYTES)
return 0;
- while(a[j] == 0 && j <= size)
+ while(j <= size && a[j] == 0)
++j;
memcpy(dst, a + j, size - j + 1);
++j;
memcpy(dst, a + j, size - j + 1);
{
char passphrase[128], passphrase1[128];
FILE *f;
{
char passphrase[128], passphrase1[128];
FILE *f;
struct t_confent *tcent;
struct t_pw eps_passwd;
struct t_confent *tcent;
struct t_pw eps_passwd;
if((bakfp = fopen(bakfile2, "wb")) == NULL &&
(unlink(bakfile2) < 0 || (bakfp = fopen(bakfile2, "wb")) == NULL)) {
fclose(passfp);
if((bakfp = fopen(bakfile2, "wb")) == NULL &&
(unlink(bakfile2) < 0 || (bakfp = fopen(bakfile2, "wb")) == NULL)) {
fclose(passfp);
+ free(bakfile);
+ free(bakfile2);
#ifdef USE_RENAME
unlink(bakfile);
#ifdef USE_RENAME
unlink(bakfile);
- if(rename(pwname, bakfile) < 0)
+ if(rename(pwname, bakfile) < 0) {
+ free(bakfile);
+ free(bakfile2);
- if(rename(bakfile2, pwname) < 0)
+ }
+ if(rename(bakfile2, pwname) < 0) {
+ free(bakfile);
+ free(bakfile2);
#else
unlink(bakfile);
link(pwname, bakfile);
#else
unlink(bakfile);
link(pwname, bakfile);