diff options
-rw-r--r-- | src/input/input_dvd.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 446b7c778..8656097bc 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -1374,10 +1374,7 @@ check_solaris_vold_device(dvd_input_class_t *this) (volume_action = getenv("VOLUME_ACTION")) != NULL && strcmp(volume_action, "insert") == 0) { - device = malloc(strlen(volume_device) + strlen(volume_name) + 2); - if (device == NULL) - return; - sprintf(device, "%s/%s", volume_device, volume_name); + asprintf(&device, "%s/%s", volume_device, volume_name); if (stat(device, &stb) != 0 || !S_ISCHR(stb.st_mode)) { free(device); return; |