Improve error-handling for PyCapsule_GetPointer and related functions.

This commit is contained in:
Siu Kwan Lam 2012-09-15 19:10:05 -07:00
commit 9767ac4d47
4 changed files with 17 additions and 119 deletions

View file

@ -320,10 +320,6 @@ unsigned char* LLVMTargetMachineEmitFile(LLVMTargetMachineRef tmref,
// and then into a new buffer
size_t bclen = bc.size();
unsigned char *bytes = new unsigned char[bclen];
if (!bytes){
error = "Out of memory";
return NULL;
}
memcpy(bytes, bc.data(), bclen);
/* return */