Try changing:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, xsurface->w, ysurface->h, 0, GL_RGB, GL_UNSIGNED_BYTE, texturesurface->pixels);
To (if surface has alpha):
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, xsurface->w, ysurface->h, 0, GL_RGBA, GL_UNSIGNED_BYTE, texturesurface->pixels);
Or (if surface doesn't have alpha):
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, xsurface->w, ysurface->h, 0, GL_RGB, GL_UNSIGNED_BYTE, texturesurface->pixels);