(der_parse_heim_oid): avoid leaking memory
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18767 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -149,6 +149,7 @@ der_parse_heim_oid (const char *str, const char *sep, heim_oid *data)
|
|||||||
(data->length + 1) * sizeof(data->components[0]));
|
(data->length + 1) * sizeof(data->components[0]));
|
||||||
if (c == NULL) {
|
if (c == NULL) {
|
||||||
der_free_oid(data);
|
der_free_oid(data);
|
||||||
|
free(s);
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
}
|
}
|
||||||
data->components = c;
|
data->components = c;
|
||||||
@@ -156,9 +157,11 @@ der_parse_heim_oid (const char *str, const char *sep, heim_oid *data)
|
|||||||
l = strtol(w, &endptr, 10);
|
l = strtol(w, &endptr, 10);
|
||||||
if (*endptr != '\0' || l < 0 || l > INT_MAX) {
|
if (*endptr != '\0' || l < 0 || l > INT_MAX) {
|
||||||
der_free_oid(data);
|
der_free_oid(data);
|
||||||
|
free(s);
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
data->components[data->length++] = l;
|
data->components[data->length++] = l;
|
||||||
}
|
}
|
||||||
|
free(s);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user