[PATCH 2/4] gweb: Properly handle memory failure scenarios