HomeClusterLabs Projects

XML: schemas.c: ensure proper upgrade-enter fallback & guard strdup arg

Description

XML: schemas.c: ensure proper upgrade-enter fallback & guard strdup arg

Former should have been in commit e535c3f4d; latter is an attempt to
make static analysis happy (despite that possibility is excluded as
long as the array of schemas in evidence only goes through
add_schema_by_version).

Also guard against some relevant cases where strdup might fail for OOM
condition -- when such result gets passed as

get_schema_path(NULL, result_of_strdup);

for which the outcome is now (correctly) also NULL, so it suffices to
check for that very NULL only.

Details

Provenance
Jan Pokorný <jpokorny@redhat.com>Authored on Aug 31 2018, 12:48 PM
Parents
rPdd6fd26f7794: Merge pull request #1575 from kgaillot/fixes
Branches
Unknown
Tags
Unknown

Event Timeline