It's an example of syllepsis:
(rhetoric) A figure of speech in which one word simultaneously modifies two or more other words such that the modification must be understood differently with respect to each modified word; often causing humorous incongruity
For more examples and discussion, see
• Using verbs with multiple meanings,
• Stop if you feel faint or pain! [duplicate],
• She was carrying twins and a bulky bag in her hands [duplicate],
• Is this sentence semantically correct?
Also see the wikipedia zeugma article, which distinguishes Type 1, Grammatical Syllepsis (or, zeugma) from Type 2, Semantic Syllepsis (or, syllepsis), giving as examples of Type 1,
• He works his work, I mine. (Tennyson, “Ulysses”)
• They saw lots of thunder and lightning. [Can't see thunder]
and of Type 2,
• Miss Bolo [...] went straight home, in a flood of tears and a sedan-chair. (Charles Dickens, The Pickwick Papers, Chapter 35)
• You are free to execute your laws and your citizens as you see fit. (Star Trek: The Next Generation)
• When he asked "What in heaven?" she made no reply, up her mind, and a dash for the door. (Flanders and Swann, Have Some Madeira M'Dear) (1,2,3,4)