I've got a char array

Code:
char *vec;
and i allocate memory for a number of elemets

Code:
vec = (char*) malloc ((sizeof(char))*(number_of_elemets));
i do that in main.
then i call a free function

Code:
free_mem (vec);
the function code is:

Code:
void free_mem (char *vec,number_of _elements)
{   
        for (i=0;i<(number_of _elements);i++)
	{
                 	free (vec[i]);
	}
}
it gives me errors
what's wrong?
thanks!!