diff options
-rw-r--r-- | source3/param/loadparm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 85329e8c53..aebf43c9a5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3361,7 +3361,10 @@ char *volume_label(int snum) /* lp_volume returns a unix charset - lp_servicename returns a dos codepage - convert so volume_label() always returns UNIX. */ - return (dos_to_unix(lp_servicename(snum), False)); + char *p = dos_to_unix(lp_servicename(snum), False); + int len = strlen(p)+1; + ret = (char *)talloc(lp_talloc, len); + memcpy(ret, p, len); } return (ret); } |