(generate_password): memory leak in error condition case

From Coverity NetBSD CID#1887


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17005 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-04-07 13:09:17 +00:00
parent 6b76beb9d8
commit 1cb80fec51

View File

@@ -134,8 +134,10 @@ generate_password(char **pw, int num_classes, ...)
}
va_end(ap);
*pw = malloc(len + 1);
if(*pw == NULL)
if(*pw == NULL) {
free(classes);
return;
}
for(i = 0; i < len; i++) {
int j;
int x = RND(rbuf, sizeof(rbuf), &rleft) % (len - i);