Orphans: We love you, Miss Hannigan.
Miss Hannigan: Shut up.
Annie: *yelling* Cut it out! I mean it! Do you want Miss Hannigan to come in here!? Go back to bed! *glares up at Pepper* Now, or you'll have me to deal with!
Pepper: Ah, blow it out your old wazoo.
Annie: Leaping lizards!
Answer: Most likely Mr Warbucks had some sway in the outcome of things. Because Mrs Hannigan in the end did try to save her life, and was also assaulted by her own brother when she turned on him, Annie and Mr Warbucks statement probably got the police to let her go. Also it would seem that Punjab liked her. She came around to the right side in the end.