Let client code handling mem allocations failures

Plus std::bad_alloc was not catched...