|
|
|
|
|
by foldr
1311 days ago
|
|
>and this kind of leak has side effects Only if the calling function does something with the pointer (which it generally won't, if err is non-nil). If the calling code does do something with the pointer even when err is non-nil, then either (a) the value of the pointer is meaningful, and this is fine; or (b) there's a logic error in the calling code, which is a far more serious bug than a potential memory leak. So I don't really see the problem here. |
|
At least Go doesn’t use RAII, so inadvertently pinning a pointer won’t keep a socket open or a lock held.