Do OpenGL commands copy my data right away?

I have a variable that is on stack
float myVars[4] = {0.f,0.f,1.f,0.f};
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_POSITION, myVars)

Will OpenGL copy the data right at this point? Since after this line my myVars variable will go out of scope and get destroyed.

Yes.