repo: Ensure load_variant_if_exists sets NULL value

Spotted by @jlebon - we usually expect callers to zero, but
let's be explicit.
This commit is contained in:
Colin Walters 2021-03-30 20:51:51 +00:00
parent 0c0e58e06c
commit 57270db9a1
1 changed files with 4 additions and 0 deletions

View File

@ -3686,6 +3686,10 @@ load_metadata_internal (OstreeRepo *self,
g_return_val_if_fail (OSTREE_OBJECT_TYPE_IS_META (objtype), FALSE);
g_return_val_if_fail (objtype == OSTREE_OBJECT_TYPE_COMMIT || out_state == NULL, FALSE);
/* Ensure this is set to NULL if we didn't find the object */
if (out_variant)
*out_variant = NULL;
/* Special caching for dirmeta objects, since they're commonly referenced many
* times.
*/