Please sign in to comment.
Fix potential memory leak in SUUIDModelHash
This leak (caught by the static analyzer) would occur if the do-while loop hit a break before free() was called. Instead of allocating memory on the heap, it is now being dynamically allocated on the stack. Additionally, there was a (very) small chance that the 'result' string would be nil if for some crazy reason the returned value for 'hw.machine' was not a proper UTF-8 encoded string. However unlikely for that to occur, the code was changed for correctness.
- Loading branch information...