Browse Source

libpkgconf: pkg: mark owning client earlier, to allow for refactoring out the rfc822 parser

William Pitcock 1 year ago
parent
commit
0f17a4f390
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      libpkgconf/pkg.c

+ 1
- 1
libpkgconf/pkg.c View File

@@ -244,6 +244,7 @@ pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *filename, FILE *
244 244
 	size_t lineno = 0;
245 245
 
246 246
 	pkg = calloc(sizeof(pkgconf_pkg_t), 1);
247
+	pkg->owner = client;
247 248
 	pkg->filename = strdup(filename);
248 249
 	pkgconf_tuple_add(client, &pkg->vars, "pcfiledir", pkg_get_parent_dir(pkg, pathbuf, sizeof pathbuf), true);
249 250
 
@@ -450,7 +451,6 @@ pkgconf_pkg_ref(pkgconf_client_t *client, pkgconf_pkg_t *pkg)
450 451
 	if (pkg->owner != NULL && pkg->owner != client)
451 452
 		PKGCONF_TRACE(client, "WTF: client %p refers to package %p owned by other client %p", client, pkg, pkg->owner);
452 453
 
453
-	pkg->owner = client;
454 454
 	pkg->refcount++;
455 455
 	PKGCONF_TRACE(client, "refcount@%p: %d", pkg, pkg->refcount);
456 456