md_json_readf: fail if json_load_callback() fails
*pjson isn't guaranteed to be NULL before the call, so check the value
returned by json_load_callback() to ensure we have a valid JSON object.
@@ -925,7 +925,7 @@ apr_status_t md_json_readf(md_json_t **pjson, apr_pool_t *p, const char *fpath)
*pjson = json_create(p, j);
}
apr_file_close(f);
- return *pjson? APR_SUCCESS : APR_EINVAL;
+ return (j && *pjson) ? APR_SUCCESS : APR_EINVAL;
}
return rv;
}
