diff options
Diffstat (limited to 'sbin/pdisk/pdisk.c')
-rw-r--r-- | sbin/pdisk/pdisk.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/pdisk/pdisk.c b/sbin/pdisk/pdisk.c index d3fe0c88b05..ce373b30fc3 100644 --- a/sbin/pdisk/pdisk.c +++ b/sbin/pdisk/pdisk.c @@ -1037,8 +1037,7 @@ do_display_block(partition_map_header *map, char *alt_name) return; } } else { - name = malloc(strlen(alt_name)+1); - strcpy(name, alt_name); + name = strdup(alt_name); } m = open_pathname_as_media(name, O_RDONLY); if (m == 0) { |