Fix memory issues

Fix  memory leaks with ```CFStringRef UUID``` and ```void *buffer = malloc(length);```