(gss_adat): fix name allocation bug

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12359 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2003-06-13 12:08:21 +00:00
parent 52e18010ee
commit bc6e02716a

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998 - 2002 Kungliga Tekniska H<>gskolan
* Copyright (c) 1998 - 2003 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -219,12 +219,13 @@ gss_adat(void *app_data, void *buf, size_t len)
gss_release_buffer(&min_stat, &export_name);
goto out;
}
name = realloc(export_name.value, export_name.length + 1);
name = malloc(export_name.length + 1);
if(name == NULL) {
reply(500, "Out of memory");
gss_release_buffer(&min_stat, &export_name);
goto out;
}
memcpy(name, export_name.value, export_name.length);
name[export_name.length] = '\0';
gss_release_buffer(&min_stat, &export_name);
d->client_name = name;