The oe-init-build-env-memres script can be used like: $ ./oe-init-build-env-memres it does not fail like the oe-init-build-env does when not sourced.
the integration of this fix can be seen at: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=master-next&id=1d43c3c2141ed367dd01d1d9d34df0c96d4fe25b