Check palindrome calculating mid pointer

Given a string, check if it is a palindrome by calculating the mid pointer for the string, so that the first part and the reverse of the second part is compared. If all the characters matches, except the middle character, then print as "palindrome" else "not a palindrome".


Implementation:
#include <stdio.h>
int main(void) {
   char *s;
   int i,j,len,flag=1;
   s=(char*)malloc(sizeof(char));
   scanf("%s",s);
   len=strlen(s);
   for(i=0,j=len-1;i<len/2 && j>=len/2;i++,j--)
   {
     if(!(*(s+i)==*(s+j)))
      flag=0;
   }
   if(flag)
    printf("palindrome");
   else
    printf("not palindrome");
   return 0;
}