Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

free(operationBytes);不会执行 #8

Closed
ChenZeBin opened this issue Oct 16, 2019 · 1 comment
Closed

free(operationBytes);不会执行 #8

ChenZeBin opened this issue Oct 16, 2019 · 1 comment

Comments

@ChenZeBin
Copy link

if (cryptStatus == kCCSuccess) {
// 这个return后,下面的free就不会执行了
return [NSData dataWithBytesNoCopy:operationBytes length:actualOutSize];
}
free(operationBytes);
operationBytes = NULL;
return nil;

@WelkinXie
Copy link
Owner

调用 dataWithBytesNoCopy 后不需要 free,原因参见苹果文档

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants