Lawful consideration

Hrishikesh Ransing (27 Points)

22 July 2019  
‘A’ promises to drop prosecution instituted against ‘B’ for robbery and ‘B’ promises to restore the value of the things taken. The agreement is void, as its object is unlawful.
Why the object is unlawful?