subl $4, %esp means move the stack pointer up 4 places, (allocate an extra memory location on the top of the stack).
You should allocate and deallocate in multiples of 4, remember, an address on a 32bit processor/os is 4 bytes.

In your main() assembly output it will add esp, 4 (this is intel syntax), this cleans the top position of the stack, for the 1 byte of memory you allocated for your buffer.

I have absolutely no idea why it gives you 7 memory locations when you ask for 3 bytes.