mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 09:12:44 +00:00
MFC r287247: Plug memory leaks when running out of memory.
Reported by: clang scan-build
This commit is contained in:
parent
bffc7de59b
commit
f879fe23c1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=287792
@ -275,15 +275,17 @@ EndElement(void *userData, const char *name)
|
||||
XML_StopParser(mt->parser, 0);
|
||||
warn("Cannot allocate memory during processing of '%s' "
|
||||
"element", name);
|
||||
free(p);
|
||||
return;
|
||||
}
|
||||
gc->lg_name = strdup(name);
|
||||
if (gc->lg_name == NULL) {
|
||||
free(gc);
|
||||
mt->error = errno;
|
||||
XML_StopParser(mt->parser, 0);
|
||||
warn("Cannot allocate memory during processing of '%s' "
|
||||
"element", name);
|
||||
free(gc);
|
||||
free(p);
|
||||
return;
|
||||
}
|
||||
gc->lg_val = p;
|
||||
|
Loading…
Reference in New Issue
Block a user