Commit c15a04c4 authored by cRTrn13's avatar cRTrn13

Proper BLURAY malloc fix

parent 7e920d04
...@@ -6,17 +6,13 @@ ...@@ -6,17 +6,13 @@
#include "util/macro.h" #include "util/macro.h"
#include "util/logging.h" #include "util/logging.h"
BLURAY *bd_open(const char* device_path, const char* keyfile_path) BLURAY *bd_open(const char* device_path, const char* keyfile_path)
{ {
BLURAY *bd = NULL; BLURAY *bd = malloc(sizeof(BLURAY));
printf("A\n");
if (device_path) { if (device_path) {
strncpy(bd->device_path, device_path, 100); strncpy(bd->device_path, device_path, 100);
bd = malloc(sizeof(BLURAY));
bd->aacs = NULL; bd->aacs = NULL;
bd->h_libaacs = NULL; bd->h_libaacs = NULL;
bd->fp = NULL; bd->fp = NULL;
...@@ -38,6 +34,8 @@ BLURAY *bd_open(const char* device_path, const char* keyfile_path) ...@@ -38,6 +34,8 @@ BLURAY *bd_open(const char* device_path, const char* keyfile_path)
DEBUG(DBG_BLURAY, "BLURAY initialized! (0x%08x)\n", bd); DEBUG(DBG_BLURAY, "BLURAY initialized! (0x%08x)\n", bd);
} else { } else {
X_FREE(bd);
DEBUG(DBG_BLURAY, "No device path provided!\n"); DEBUG(DBG_BLURAY, "No device path provided!\n");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment