Is it safe/compliant for one circuit to supply grounded wall outlets in both a kitchen and a living room?
National Electrical Code says no.

National Electrical Code 2008
ARTICLE 210 Branch Circuits
210.52 Dwelling Unit Receptacle Outlets.
(B) Small Appliances.
(1) Receptacle Outlets Served. In the kitchen, pantry, breakfast room, dining room, or similar area of a dwelling unit, the two or more 20-ampere small-appliance branch circuits required by 210.11(C)(1) shall serve all wall and floor receptacle outlets covered by 210.52(A), all countertop outlets covered by 210.52(C), and receptacle outlets for refrigeration equipment.
(2) No Other Outlets. The two or more small-appliance branch circuits specified in 210.52(B)(1) shall have no other outlets.
(3) Kitchen Receptacle Requirements. Receptacles installed in a kitchen to serve countertop surfaces shall be supplied by not fewer than two small-appliance branch circuits, either or both of which shall also be permitted to supply receptacle outlets in the same kitchen and in other rooms specified in 210.52(B)(1). Additional small-appliance branch circuits shall be permitted to supply receptacle outlets in the kitchen and other rooms specified in 210.52(B)(1). No small-appliance branch circuit shall serve more than one kitchen.

210.52(B)(1) basically says, that all the receptacles in the kitchen should be supplied by 2 or more 20A circuits. 210.52(B)(2) says that there should be no other outlets on these 2 or more circuits, which means no lighting outlets and no outlets outside of the kitchen.  210.52(B)(3) says that the 2 or more circuits, can be used to supply receptacles in other 'related' rooms (pantry, breakfast room, dining room, or similar area).
Even though the kitchen and living room may share a wall; according to NEC 2008, they cannot share an electrical circuit.