zero-copy mem error; preparing for 4.0

This commit is contained in:
Olof hagsand 2019-07-12 17:00:46 +02:00
parent 8b50695e1f
commit c9ea6d99cf
4 changed files with 69 additions and 47 deletions

View file

@ -768,10 +768,10 @@ int
xmldb_get0_free(clicon_handle h,
cxobj **xp)
{
if (*xp == NULL ||
clicon_datastore_cache(h) == DATASTORE_CACHE_ZEROCOPY)
if (*xp == NULL)
return 0;
xml_free(*xp);
if (clicon_datastore_cache(h) != DATASTORE_CACHE_ZEROCOPY)
xml_free(*xp);
*xp = NULL;
return 0;
}