Browse code

sercmd: memset with proper size

Daniel-Constantin Mierla authored on 29/01/2014 21:10:09
Showing 1 changed files
... ...
@@ -1649,7 +1649,7 @@ static int get_counters_list(int s)
1649 1649
 		grp->var_no = 0;
1650 1650
 		grp->var_names=malloc(sizeof(str)*grp->cnt_vars_no);
1651 1651
 		if (grp->var_names==0) goto error_mem;
1652
-		memset(grp->var_names, 0, sizeof(str)*grp->var_no);
1652
+		memset(grp->var_names, 0, sizeof(str)*grp->cnt_vars_no);
1653 1653
 		for (r=0; r<grp->cnt_vars_no; r++) {
1654 1654
 			if (grp->cnt_vars_array[r].type!=BINRPC_T_STR)
1655 1655
 				continue;