Fix memory error detected by valgrind

The assignment name = sub.str(1) reads from the first argument given to
regex_match(), but previously this was a temporary object which was already
out of scope. This did probably not matter much in practice, but invoked
undefined behaviour, and as we all know this is allowed ton format your hard
disk or kill to your cat, so better fix this.
Merge remote-tracking branch 'github/build-bot-2.1.x' into bleeding-edge-2.1.x
2014.11.19-20.00