Count the occurrence of a substring in a string

Given a string and a sub-string, find the number of times sub-string occurred in the string.



#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void) {
   char *s,*v;
   int slen,vlen,k,i,flag,count=0,j;
   s=(char*)malloc(sizeof(char));
   v=(char*)malloc(sizeof(char));
   scanf("%s",s);
   scanf("%s",v);
   slen=strlen(s);
   vlen=strlen(v);
   for(i=0;i<slen;i++)
   {
     flag=1;
     if(*(s+i)==*v)
     {
      k=i;
      for(j=0;j<vlen;j++,k++)
      { 
        if(*(s+k)!=*(v+j))
        {
          flag=0;
          break;
        }
      }
      if(flag)
      {
        count++;
      }
     }
   }
   printf("%s occurrence in %s is %d",v,s,count);
   return 0;
}