qcap: Fix a mem leak on an error path. Found by Smatch.