diff options
author | pjd <pjd@FreeBSD.org> | 2006-04-07 15:33:04 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-04-07 15:33:04 +0000 |
commit | aa5c1066ffe09e054adbe29e77187418997d933b (patch) | |
tree | ecc158d794bf733af7c1fea596a3825a16e83020 /sbin/geom/core | |
parent | b72fba923c13bb674cd94bd0450909f9c3bdefdf (diff) | |
download | FreeBSD-src-aa5c1066ffe09e054adbe29e77187418997d933b.zip FreeBSD-src-aa5c1066ffe09e054adbe29e77187418997d933b.tar.gz |
Allocate memory for NUL-termination as well.
MFC after: 2 days
Diffstat (limited to 'sbin/geom/core')
-rw-r--r-- | sbin/geom/core/geom.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 70d645b..06cd2f6 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -523,7 +523,7 @@ set_class_name(void) s1 = class_name; for (; *s1 != '\0'; s1++) *s1 = tolower(*s1); - gclass_name = malloc(strlen(class_name)); + gclass_name = malloc(strlen(class_name) + 1); if (gclass_name == NULL) errx(EXIT_FAILURE, "No memory"); s1 = gclass_name; |