In krb5int_utf8s_to_ucs2les, free the correct value on error, instead
authorGreg Hudson <ghudson@mit.edu>
Wed, 4 Feb 2009 19:25:51 +0000 (19:25 +0000)
committerGreg Hudson <ghudson@mit.edu>
Wed, 4 Feb 2009 19:25:51 +0000 (19:25 +0000)
of the caller-supplied result pointer.

ticket: 6360
tags: pullup
target_version: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21881 dc483132-0cff-0310-8789-dd5450dbe970

src/util/support/utf8_conv.c

index 185dc4ba77b9384c1af5dca049795ce18062c5dd..531b3d2d20f2eaa683742d5573869b9985671766 100644 (file)
@@ -199,7 +199,7 @@ krb5int_utf8s_to_ucs2les(const char *utf8s,
 
     len = k5_utf8s_to_ucs2s((krb5_ucs2 *)*ucs2les, utf8s, chars + 1, 1);
     if (len < 0) {
-       free(ucs2les);
+       free(*ucs2les);
        *ucs2les = NULL;
        return EINVAL;
     }