]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
libpakfire: Drop pakfire_free
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Feb 2021 19:27:17 +0000 (19:27 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Feb 2021 19:27:17 +0000 (19:27 +0000)
There is no point in using an own function to free any memory.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
36 files changed:
src/_pakfire/archive.c
src/_pakfire/key.c
src/_pakfire/package.c
src/_pakfire/pakfire.c
src/_pakfire/relation.c
src/_pakfire/repo.c
src/_pakfire/step.c
src/libpakfire/archive.c
src/libpakfire/db.c
src/libpakfire/file.c
src/libpakfire/filelist.c
src/libpakfire/filter.c
src/libpakfire/include/pakfire/util.h
src/libpakfire/key.c
src/libpakfire/libpakfire.sym
src/libpakfire/package.c
src/libpakfire/packagelist.c
src/libpakfire/pakfire.c
src/libpakfire/parser.c
src/libpakfire/parser/grammar.y
src/libpakfire/parser/scanner.l
src/libpakfire/problem.c
src/libpakfire/relation.c
src/libpakfire/relationlist.c
src/libpakfire/repo.c
src/libpakfire/request.c
src/libpakfire/selector.c
src/libpakfire/solution.c
src/libpakfire/step.c
src/libpakfire/transaction.c
src/libpakfire/util.c
tests/libpakfire/archive.c
tests/libpakfire/key.c
tests/libpakfire/makefile.c
tests/libpakfire/parser.c
tests/libpakfire/util.c

index e50f5c899d0b44f42ce5f738cc57589e2f4d4c9c..cac0ece9bf284bd9aeaac674941cc0015f31710f 100644 (file)
@@ -87,7 +87,7 @@ static PyObject* Archive_read(ArchiveObject* self, PyObject* args, PyObject* kwd
 
        int ret = pakfire_archive_read(self->archive, filename, &data, &data_size, flags);
        if (ret) {
-               pakfire_free(data);
+               free(data);
 
                Py_RETURN_NONE;
        }
@@ -95,7 +95,7 @@ static PyObject* Archive_read(ArchiveObject* self, PyObject* args, PyObject* kwd
        // XXX This is not ideal since PyBytes_FromStringAndSize creates a
        // copy of data.
        PyObject* bytes = PyBytes_FromStringAndSize(data, data_size);
-       pakfire_free(data);
+       free(data);
 
        return bytes;
 }
@@ -142,7 +142,7 @@ static PyObject* Archive_extract(ArchiveObject* self, PyObject* args) {
 
        // Extract payload
        int r = pakfire_archive_extract(self->archive, prefix, PAKFIRE_ARCHIVE_USE_PAYLOAD);
-       pakfire_free(prefix);
+       free(prefix);
 
        // Throw an exception on error
        if (r) {
@@ -187,7 +187,7 @@ static PyObject* Archive_get(ArchiveObject* self, PyObject* args) {
                Py_RETURN_NONE;
 
        PyObject* ret = PyUnicode_FromString(value);
-       pakfire_free(value);
+       free(value);
 
        return ret;
 }
index 36f81719f125afeb7501dae8e067e3d3e316282e..457d34c389fa4975a5853fdd22d3d0f9a3ef6efc 100644 (file)
@@ -74,7 +74,7 @@ static PyObject* Key_str(KeyObject* self) {
        char* string = pakfire_key_dump(self->key);
 
        PyObject* object = PyUnicode_FromString(string);
-       pakfire_free(string);
+       free(string);
 
        return object;
 }
@@ -101,7 +101,7 @@ static PyObject* Key_export(KeyObject* self, PyObject* args) {
        char* export = pakfire_key_export(self->key, mode);
 
        PyObject* object = PyUnicode_FromFormat("%s", export);
-       pakfire_free(export);
+       free(export);
 
        return object;
 }
index 8f7ffc61613eba63858d01ea4e8b778ffd04c568..9df378ebaba6e7f20919dc7eedcd841bb114f32c 100644 (file)
@@ -77,7 +77,7 @@ static PyObject* Package_repr(PackageObject* self) {
 
        PyObject* repr = PyUnicode_FromFormat("<_pakfire.Package object id %ld, %s>",
                Package_hash(self), nevra);
-       pakfire_free(nevra);
+       free(nevra);
 
        return repr;
 }
@@ -86,7 +86,7 @@ static PyObject* Package_str(PackageObject* self) {
        char* nevra = pakfire_package_get_nevra(self->package);
 
        PyObject* str = PyUnicode_FromString(nevra);
-       pakfire_free(nevra);
+       free(nevra);
 
        return str;
 }
@@ -300,12 +300,12 @@ static PyObject* Package_get_groups(PackageObject* self) {
        while ((group = *groups++) != NULL) {
                PyObject* item = PyUnicode_FromString(group);
                PyList_Append(list, item);
-               pakfire_free(group);
+               free(group);
 
                Py_DECREF(item);
        }
 
-       pakfire_free(groups);
+       free(groups);
 
        return list;
 }
@@ -426,7 +426,7 @@ static void Package_set_buildtime(PackageObject* self, PyObject* value) {
 static PyObject* Package_get_cache_path(PackageObject* self) {
        char* cache_path = pakfire_package_get_cache_path(self->package);
        PyObject* ret = PyUnicode_FromString(cache_path);
-       pakfire_free(cache_path);
+       free(cache_path);
 
        return ret;
 }
@@ -451,7 +451,7 @@ static PyObject* Package_get_location(PackageObject* self) {
        char* location = pakfire_package_get_location(self->package);
 
        PyObject* str = PyUnicode_FromString(location);
-       pakfire_free(location);
+       free(location);
 
        return str;
 }
index 6cf25d00d795bd2f9ba3e5948cec263bbd9acefe..5b90967b39bd669e77bc19175d032d71ddd8c9d2 100644 (file)
@@ -147,7 +147,7 @@ static PyObject* Pakfire_get_cache_path(PakfireObject* self) {
                Py_RETURN_NONE;
 
        PyObject* obj = PyUnicode_FromString(path);
-       pakfire_free(path);
+       free(path);
 
        return obj;
 }
index 215aea6ee5e11697b106e1f88e1b20e449d736e5..ac4f21cc69f82b7f4012ad5eaf8b310a0abb5128 100644 (file)
@@ -77,7 +77,7 @@ static PyObject* Relation_repr(RelationObject* self) {
        char* relation = pakfire_relation_str(self->relation);
 
        PyObject* repr = PyUnicode_FromFormat("<_pakfire.Relation %s>", relation);
-       pakfire_free(relation);
+       free(relation);
 
        return repr;
 }
@@ -86,7 +86,7 @@ static PyObject* Relation_str(RelationObject* self) {
        char* relation = pakfire_relation_str(self->relation);
 
        PyObject* str = PyUnicode_FromString(relation);
-       pakfire_free(relation);
+       free(relation);
 
        return str;
 }
index bbf3e195891a5e63635fdabb17a9a05f58fcb761..40335260f67791d146a8c4c1ebbb4ff17975bd3e 100644 (file)
@@ -221,7 +221,7 @@ static PyObject* Repo_get_config(RepoObject* self) {
 
        if (config) {
                PyObject* obj = PyUnicode_FromString(config);
-               pakfire_free(config);
+               free(config);
 
                return obj;
        }
@@ -380,7 +380,7 @@ static PyObject* Repo_cache_path(RepoObject* self, PyObject* args) {
        char* cache_path = pakfire_repo_cache_get_path(self->repo, path);
 
        PyObject* obj = PyUnicode_FromString(cache_path);
-       pakfire_free(cache_path);
+       free(cache_path);
 
        return obj;
 }
index c8cba3271b17ae42e84262e7139be1335125b20d..80d795a85a45a9d1263d245d6b4d8a4738df1dcb 100644 (file)
@@ -91,7 +91,7 @@ static PyObject* Step_repr(StepObject* self) {
                pakfire_step_get_type_string(self->step), nevra);
 
        pakfire_package_unref(package);
-       pakfire_free(nevra);
+       free(nevra);
 
        return repr;
 }
index b2a1a6d9794066129ef249733ecfa178f76f263b..2ca54d01ab39be8666f691fc897ad4ac05196f5e 100644 (file)
@@ -140,7 +140,7 @@ static int archive_read(struct archive* a, void** data, size_t* data_size) {
                        break;
 
                if (size < 0) {
-                       pakfire_free(*data);
+                       free(*data);
                        *data = NULL;
 
                        return 1;
@@ -177,7 +177,7 @@ static ssize_t payload_archive_read(struct archive* a, void* client_data, const
 static int payload_archive_close(struct archive* a, void* client_data) {
        struct payload_archive_data* data = client_data;
 
-       pakfire_free(data);
+       free(data);
 
        return ARCHIVE_OK;
 }
@@ -226,8 +226,8 @@ static void pakfire_archive_checksum_free(archive_checksum_t* c) {
        DEBUG(c->pakfire, "Releasing archive checksum at %p\n", c);
 
        pakfire_unref(c->pakfire);
-       pakfire_free(c->filename);
-       pakfire_free(c);
+       free(c->filename);
+       free(c);
 }
 
 static archive_checksum_t* pakfire_archive_checksum_create(Pakfire pakfire, const char* filename, archive_checksum_algo_t algo, const char* s) {
@@ -285,8 +285,8 @@ static void pakfire_archive_signature_free(PakfireArchiveSignature signature) {
        if (signature->key)
                pakfire_key_unref(signature->key);
 
-       pakfire_free(signature->sigdata);
-       pakfire_free(signature);
+       free(signature->sigdata);
+       free(signature);
 }
 
 PAKFIRE_EXPORT PakfireArchiveSignature pakfire_archive_signature_ref(PakfireArchiveSignature signature) {
@@ -343,7 +343,7 @@ static void pakfire_archive_free(PakfireArchive archive) {
        DEBUG(archive->pakfire, "Releasing archive at %p\n", archive);
 
        if (archive->path)
-               pakfire_free(archive->path);
+               free(archive->path);
 
        // Free checksums
        archive_checksum_t** checksums = archive->checksums;
@@ -356,7 +356,7 @@ static void pakfire_archive_free(PakfireArchive archive) {
                while (signatures && *signatures)
                        pakfire_archive_signature_unref(*signatures++);
 
-               pakfire_free(archive->signatures);
+               free(archive->signatures);
        }
 
        // Free scriptlets
@@ -368,7 +368,7 @@ static void pakfire_archive_free(PakfireArchive archive) {
 
        pakfire_parser_unref(archive->parser);
        pakfire_unref(archive->pakfire);
-       pakfire_free(archive);
+       free(archive);
 }
 
 PAKFIRE_EXPORT PakfireArchive pakfire_archive_unref(PakfireArchive archive) {
@@ -411,7 +411,7 @@ static int pakfire_archive_parse_entry_metadata(PakfireArchive archive,
 
        // Parse metadata file
        r = pakfire_parser_parse_data(archive->parser, (const char*)data, data_size);
-       pakfire_free(data);
+       free(data);
 
        return r;
 }
@@ -433,7 +433,7 @@ static int pakfire_archive_parse_entry_filelist(PakfireArchive archive,
                r = pakfire_filelist_create_from_file(&archive->filelist, data, archive->format);
        }
 
-       pakfire_free(data);
+       free(data);
 
        return r;
 }
@@ -500,7 +500,7 @@ static int pakfire_archive_parse_entry_checksums(PakfireArchive archive,
        // Terminate the list
        *checksums = NULL;
 
-       pakfire_free(data);
+       free(data);
 
        return 0;
 }
@@ -685,7 +685,7 @@ static int archive_extract(Pakfire pakfire, struct archive* a, const char* prefi
                archive_entry_set_pathname(entry, pathname);
 
                DEBUG(pakfire, "Extracting %s (%zu bytes)\n", pathname, size);
-               pakfire_free(pathname);
+               free(pathname);
 
                // Update hardlink targets
                const char* hardlink = archive_entry_hardlink(entry);
@@ -695,7 +695,7 @@ static int archive_extract(Pakfire pakfire, struct archive* a, const char* prefi
 
                        // Update the entry
                        archive_entry_set_hardlink(entry, h);
-                       pakfire_free(h);
+                       free(h);
                }
 
                // Create file
@@ -875,7 +875,7 @@ PAKFIRE_EXPORT char* pakfire_archive_extraction_path(PakfireArchive archive, con
        // Cleanup
        pakfire_package_unref(pkg);
        pakfire_repo_unref(repo);
-       pakfire_free(nevra);
+       free(nevra);
 
        return prefix;
 }
@@ -1265,76 +1265,76 @@ PAKFIRE_EXPORT PakfirePackage pakfire_archive_make_package(PakfireArchive archiv
                archive->pakfire, repo, name, evr, (arch) ? arch : "src"
        );
 
-       pakfire_free(name);
-       pakfire_free(type);
-       pakfire_free(e);
-       pakfire_free(v);
-       pakfire_free(r);
-       pakfire_free(evr);
+       free(name);
+       free(type);
+       free(e);
+       free(v);
+       free(r);
+       free(evr);
        if (arch)
-               pakfire_free(arch);
+               free(arch);
 
 #ifdef ENABLE_DEBUG
        char* nevra = pakfire_package_get_nevra(pkg);
        DEBUG(archive->pakfire, "Created package %s (%p) from archive %p\n",
                nevra, pkg, archive);
-       pakfire_free(nevra);
+       free(nevra);
 #endif
 
        // Set filename
        char* filename = pakfire_basename(archive->path);
        if (filename) {
                pakfire_package_set_filename(pkg, filename);
-               pakfire_free(filename);
+               free(filename);
        }
 
        // Set UUID
        char* uuid = pakfire_archive_get(archive, "package.uuid");
        if (uuid) {
                pakfire_package_set_uuid(pkg, uuid);
-               pakfire_free(uuid);
+               free(uuid);
        }
 
        // Set groups
        char* groups = pakfire_archive_get(archive, "package.groups");
        if (groups) {
                pakfire_package_set_groups(pkg, groups);
-               pakfire_free(groups);
+               free(groups);
        }
 
        // Set maintainer
        char* maintainer = pakfire_archive_get(archive, "package.maintainer");
        if (maintainer) {
                pakfire_package_set_maintainer(pkg, maintainer);
-               pakfire_free(maintainer);
+               free(maintainer);
        }
 
        // Set URL
        char* url = pakfire_archive_get(archive, "package.url");
        if (url) {
                pakfire_package_set_url(pkg, url);
-               pakfire_free(url);
+               free(url);
        }
 
        // Set license
        char* license = pakfire_archive_get(archive, "package.license");
        if (license) {
                pakfire_package_set_license(pkg, license);
-               pakfire_free(license);
+               free(license);
        }
 
        // Set summary
        char* summary = pakfire_archive_get(archive, "package.summary");
        if (summary) {
                pakfire_package_set_summary(pkg, summary);
-               pakfire_free(summary);
+               free(summary);
        }
 
        // Set description
        char* description = pakfire_archive_get(archive, "package.description");
        if (description) {
                pakfire_package_set_description(pkg, description);
-               pakfire_free(description);
+               free(description);
        }
 
        // Get package size
@@ -1344,7 +1344,7 @@ PAKFIRE_EXPORT PakfirePackage pakfire_archive_make_package(PakfireArchive archiv
        char* size = pakfire_archive_get(archive, "package.size");
        if (size) {
                size_t s = pakfire_string_to_size(size);
-               pakfire_free(size);
+               free(size);
 
                pakfire_package_set_installsize(pkg, s);
        }
@@ -1353,21 +1353,21 @@ PAKFIRE_EXPORT PakfirePackage pakfire_archive_make_package(PakfireArchive archiv
        char* vendor = pakfire_archive_get(archive, "distribution.vendor");
        if (vendor) {
                pakfire_package_set_vendor(pkg, vendor);
-               pakfire_free(vendor);
+               free(vendor);
        }
 
        // Set build host
        char* buildhost = pakfire_archive_get(archive, "build.host");
        if (buildhost) {
                pakfire_package_set_buildhost(pkg, buildhost);
-               pakfire_free(buildhost);
+               free(buildhost);
        }
 
        // Set build time
        char* buildtime = pakfire_archive_get(archive, "build.time");
        if (buildtime) {
                unsigned long long t = strtoull(buildtime, NULL, 10);
-               pakfire_free(buildtime);
+               free(buildtime);
 
                pakfire_package_set_buildtime(pkg, t);
        }
index bb1db554da6f82b032bedf61d4851b84abd31766..461404898fca9548025f5b3e2cc0806f7b38977f 100644 (file)
@@ -112,7 +112,7 @@ static void pakfire_db_free(struct pakfire_db* db) {
 
        pakfire_unref(db->pakfire);
 
-       pakfire_free(db);
+       free(db);
 }
 
 static sqlite3_value* pakfire_db_get(struct pakfire_db* db, const char* key) {
index f15bdac6f75c7a481794043adcd9b6f027738ec9..5bf716d790c31f27290ba7d4e66f576013e9569b 100644 (file)
@@ -67,15 +67,15 @@ PAKFIRE_EXPORT int pakfire_file_create(PakfireFile* file) {
 
 static void pakfire_file_free(PakfireFile file) {
        if (file->name)
-               pakfire_free(file->name);
+               free(file->name);
        if (file->user)
-               pakfire_free(file->user);
+               free(file->user);
        if (file->group)
-               pakfire_free(file->group);
+               free(file->group);
        if (file->chksum)
-               pakfire_free(file->chksum);
+               free(file->chksum);
 
-       pakfire_free(file);
+       free(file);
 }
 
 PAKFIRE_EXPORT PakfireFile pakfire_file_ref(PakfireFile file) {
@@ -156,8 +156,8 @@ PAKFIRE_EXPORT void pakfire_file_sprintf(PakfireFile file, char* str, size_t len
        snprintf(str, len, "%s %-8s %-8s %8d %s %s", perms, user, group,
                (int)size, mtime, name);
 
-       pakfire_free(perms);
-       pakfire_free(mtime);
+       free(perms);
+       free(mtime);
 }
 
 PAKFIRE_EXPORT const char* pakfire_file_get_name(PakfireFile file) {
@@ -166,7 +166,7 @@ PAKFIRE_EXPORT const char* pakfire_file_get_name(PakfireFile file) {
 
 PAKFIRE_EXPORT void pakfire_file_set_name(PakfireFile file, const char* name) {
        if (file->name)
-               pakfire_free(file->name);
+               free(file->name);
 
        if (*name == '/') {
                file->name = pakfire_strdup(name);
index aed051174675b0082564366fc3e46c498b72db6f..21bb4bbb308d4f6549c1769cb0ed8d3b310e6211 100644 (file)
@@ -61,7 +61,7 @@ PAKFIRE_EXPORT int pakfire_filelist_create(PakfireFilelist* list) {
 
 static void pakfire_filelist_free(PakfireFilelist list) {
        pakfire_filelist_clear(list);
-       pakfire_free(list);
+       free(list);
 }
 
 PAKFIRE_EXPORT PakfireFilelist pakfire_filelist_ref(PakfireFilelist list) {
index 0be50e1c854c70dc6720d5e5d0e8a4744f2e3421..386612785d69ab1e3f1ad28a27b2f58974374be5 100644 (file)
@@ -18,6 +18,8 @@
 #                                                                             #
 #############################################################################*/
 
+#include <stdlib.h>
+
 #include <pakfire/filter.h>
 #include <pakfire/private.h>
 #include <pakfire/types.h>
@@ -30,6 +32,6 @@ PAKFIRE_EXPORT PakfireFilter pakfire_filter_create(void) {
 }
 
 PAKFIRE_EXPORT void pakfire_filter_free(PakfireFilter filter) {
-       pakfire_free(filter->match);
-       pakfire_free(filter);
+       free(filter->match);
+       free(filter);
 }
index 100971acba24bba74c7d663ef3256ffe3263b588..e3a4b8bfd35e53209a14e5294d34d08cae1613f0 100644 (file)
@@ -34,8 +34,6 @@ void* pakfire_malloc(size_t len);
 void* pakfire_calloc(size_t num, size_t len);
 void* pakfire_realloc(void* ptr, size_t size);
 
-void* pakfire_free(void* mem);
-
 char* pakfire_strdup(const char* s);
 int pakfire_string_startswith(const char* s, const char* prefix);
 
index 690b4fa8223d054abcb7fc2a07bb923c3a010efa..30be26499d9d3c54b485c3beb63e996b078accce 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <assert.h>
 #include <gpgme.h>
+#include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -80,7 +81,7 @@ gpgme_ctx_t pakfire_get_gpgctx(Pakfire pakfire) {
 
        // Setup engine
        error = gpgme_ctx_set_engine_info(ctx, GPGME_PROTOCOL_OpenPGP, NULL, home);
-       pakfire_free(home);
+       free(home);
        if (gpg_err_code(error) != GPG_ERR_NO_ERROR)
                goto FAIL;
 
@@ -171,7 +172,7 @@ static void pakfire_key_free(PakfireKey key) {
        pakfire_unref(key->pakfire);
        gpgme_key_unref(key->gpgkey);
 
-       pakfire_free(key);
+       free(key);
 }
 
 PAKFIRE_EXPORT PakfireKey pakfire_key_ref(PakfireKey key) {
@@ -465,7 +466,7 @@ PAKFIRE_EXPORT char* pakfire_key_dump(PakfireKey key) {
                pakfire_key_get_fingerprint(key),
                date_created
        );
-       pakfire_free(date_created);
+       free(date_created);
 
        const char* uid = pakfire_key_get_uid(key);
        if (uid) {
@@ -476,7 +477,7 @@ PAKFIRE_EXPORT char* pakfire_key_dump(PakfireKey key) {
        if (expires) {
                        char* date_expires = pakfire_format_date(expires);
                        asprintf(&s, "%s\n    %s: %s", s, _("Expires"), date_expires);
-                       pakfire_free(date_expires);
+                       free(date_expires);
        }
 
        return s;
index 53a4d8e2040ca119890b0379dcff23d904cc9a74..f96304afcd7bc044335a91db9bc156715a3ded1f 100644 (file)
@@ -383,7 +383,6 @@ global:
        pakfire_access;
        pakfire_basename;
        pakfire_dirname;
-       pakfire_free;
        pakfire_get_errno;
        pakfire_partition_string;
        pakfire_path_isdir;
index a08eb18909fb5224a7ece4cab8890baf49153e09..e278bc22aa555d52a3349d1494786cb853c0c180 100644 (file)
@@ -90,7 +90,7 @@ static void pakfire_package_free(PakfirePackage pkg) {
        DEBUG(pkg->pakfire, "Releasing Package at %p\n", pkg);
 
        pakfire_unref(pkg->pakfire);
-       pakfire_free(pkg);
+       free(pkg);
 }
 
 PAKFIRE_EXPORT PakfirePackage pakfire_package_ref(PakfirePackage pkg) {
@@ -716,7 +716,7 @@ static void pakfire_package_dump_add_line_relations(char** str, const char* key,
 
                        if (dep) {
                                pakfire_package_dump_add_line(str, (i == 0) ? key : "", dep);
-                               pakfire_free(dep);
+                               free(dep);
                        }
                }
        }
@@ -727,7 +727,7 @@ static void pakfire_package_dump_add_line_size(char** str, const char* key, unsi
 
        if (val) {
                pakfire_package_dump_add_line(str, key, val);
-               pakfire_free(val);
+               free(val);
        }
 }
 
@@ -878,7 +878,7 @@ PAKFIRE_EXPORT int pakfire_package_is_cached(PakfirePackage pkg) {
 
        // Check if the file is readable
        int r = pakfire_access(pkg->pakfire, path, NULL, R_OK);
-       pakfire_free(path);
+       free(path);
 
        return (r == 0);
 }
@@ -906,7 +906,7 @@ PAKFIRE_EXPORT PakfireArchive pakfire_package_get_archive(PakfirePackage pkg) {
 
        // Open archive
        PakfireArchive archive = pakfire_archive_open(pkg->pakfire, path);
-       pakfire_free(path);
+       free(path);
 
        return archive;
 }
index da8ec69145058b2df69018a72b12057f2eed82cf..c11eebeec4b6b2ac14ad153ea71bf2dc262b8feb 100644 (file)
@@ -67,8 +67,8 @@ static void pakfire_packagelist_free(PakfirePackageList list) {
                pakfire_package_unref(list->elements[i]);
        }
 
-       pakfire_free(list->elements);
-       pakfire_free(list);
+       free(list->elements);
+       free(list);
 }
 
 PAKFIRE_EXPORT PakfirePackageList pakfire_packagelist_unref(PakfirePackageList list) {
index b822d8cfc2af9dfd7573c1068a5c7db1d2a8e395..e352497dd892169a2372a666fc251de70b4c5836 100644 (file)
@@ -99,8 +99,7 @@ static int pakfire_populate_pool(Pakfire pakfire) {
        return 0;
 }
 
-// A utility function is already called pakfire_free
-static void _pakfire_free(Pakfire pakfire) {
+static void pakfire_free(Pakfire pakfire) {
        DEBUG(pakfire, "Releasing Pakfire at %p\n", pakfire);
 
        pakfire_repo_free_all(pakfire);
@@ -111,15 +110,15 @@ static void _pakfire_free(Pakfire pakfire) {
        queue_free(&pakfire->installonly);
 
        if (pakfire->arch)
-               pakfire_free(pakfire->arch);
+               free(pakfire->arch);
 
        if (pakfire->path)
-               pakfire_free(pakfire->path);
+               free(pakfire->path);
 
        if (pakfire->cache_path)
-               pakfire_free(pakfire->cache_path);
+               free(pakfire->cache_path);
 
-       pakfire_free(pakfire);
+       free(pakfire);
 }
 
 PAKFIRE_EXPORT int pakfire_create(Pakfire* pakfire, const char* path, const char* arch) {
@@ -174,7 +173,7 @@ PAKFIRE_EXPORT int pakfire_create(Pakfire* pakfire, const char* path, const char
                        private_dir, strerror(errno));
                free(private_dir);
 
-               _pakfire_free(p);
+               pakfire_free(p);
                return r;
        }
 
@@ -192,7 +191,7 @@ PAKFIRE_EXPORT int pakfire_create(Pakfire* pakfire, const char* path, const char
        // Populate pool
        r = pakfire_populate_pool(p);
        if (r) {
-               _pakfire_free(p);
+               pakfire_free(p);
 
                return r;
        }
@@ -215,7 +214,7 @@ PAKFIRE_EXPORT Pakfire pakfire_unref(Pakfire pakfire) {
        if (--pakfire->nrefs > 0)
                return pakfire;
 
-       _pakfire_free(pakfire);
+       pakfire_free(pakfire);
 
        return NULL;
 }
@@ -428,7 +427,7 @@ PAKFIRE_EXPORT char* pakfire_get_cache_path(Pakfire pakfire, const char* path) {
 PAKFIRE_EXPORT void pakfire_set_cache_path(Pakfire pakfire, const char* path) {
        // Release old path
        if (pakfire->cache_path)
-               pakfire_free(pakfire->cache_path);
+               free(pakfire->cache_path);
 
        pakfire->cache_path = pakfire_strdup(path);
 
@@ -444,7 +443,7 @@ PAKFIRE_EXPORT int pakfire_cache_destroy(Pakfire pakfire, const char* path) {
 
        // Completely delete the tree of files
        int r = nftw(cache_path, _unlink, 64, FTW_DEPTH|FTW_PHYS);
-       pakfire_free(cache_path);
+       free(cache_path);
 
        // It is okay if the path doesn't exist
        if (r < 0 && errno == ENOENT)
@@ -457,7 +456,7 @@ PAKFIRE_EXPORT int pakfire_cache_stat(Pakfire pakfire, const char* path, struct
        char* cache_path = pakfire_get_cache_path(pakfire, path);
 
        int r = stat(cache_path, buffer);
-       pakfire_free(cache_path);
+       free(cache_path);
 
        return r;
 }
@@ -466,7 +465,7 @@ PAKFIRE_EXPORT int pakfire_cache_access(Pakfire pakfire, const char* path, int m
        char* cache_path = pakfire_get_cache_path(pakfire, path);
 
        int r = pakfire_access(pakfire, cache_path, NULL, mode);
-       pakfire_free(cache_path);
+       free(cache_path);
 
        return r;
 }
@@ -501,8 +500,8 @@ PAKFIRE_EXPORT FILE* pakfire_cache_open(Pakfire pakfire, const char* path, const
        f = fopen(cache_path, flags);
 
 FAIL:
-       pakfire_free(cache_path);
-       pakfire_free(cache_dirname);
+       free(cache_path);
+       free(cache_dirname);
 
        return f;
 }
index 220d9431c7be7493e80fd0963b1c21be300b25da..0a6350615d852e0788f7e9d93b156c603b4afdb4 100644 (file)
@@ -19,6 +19,7 @@
 #############################################################################*/
 
 #include <regex.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include <pakfire/errno.h>
@@ -121,10 +122,10 @@ static void pakfire_parser_free_declarations(PakfireParser parser) {
 
                // Free everything
                if (d->name)
-                       pakfire_free(d->name);
+                       free(d->name);
                if (d->value)
-                       pakfire_free(d->value);
-               pakfire_free(d);
+                       free(d->value);
+               free(d);
        }
 }
 
@@ -133,11 +134,11 @@ static void pakfire_parser_free(PakfireParser parser) {
 
        pakfire_parser_free_declarations(parser);
        if (parser->namespace)
-               pakfire_free(parser->namespace);
+               free(parser->namespace);
 
        pakfire_parser_unref(parser->parent);
        pakfire_unref(parser->pakfire);
-       pakfire_free(parser);
+       free(parser);
 }
 
 PAKFIRE_EXPORT PakfireParser pakfire_parser_unref(PakfireParser parser) {
@@ -182,7 +183,7 @@ static int pakfire_parser_set_declaration(PakfireParser parser,
        if (d) {
                // Replace value
                if (d->value)
-                       pakfire_free(d->value);
+                       free(d->value);
                d->value = pakfire_strdup(value);
 
                DEBUG(parser->pakfire, "Updated declaration: %s = %s\n",
@@ -219,7 +220,7 @@ PAKFIRE_EXPORT int pakfire_parser_set(PakfireParser parser, const char* name, co
        char* canonical_name = pakfire_parser_make_canonical_name(parser, name);
 
        int r = pakfire_parser_set_declaration(parser, canonical_name, value);
-       pakfire_free(canonical_name);
+       free(canonical_name);
 
        return r;
 }
@@ -260,7 +261,7 @@ PAKFIRE_EXPORT int pakfire_parser_append(PakfireParser parser,
 
        // Set the new value
        r = pakfire_parser_set_declaration(parser, name, buffer);
-       pakfire_free(buffer);
+       free(buffer);
 
        return r;
 }
@@ -310,10 +311,10 @@ static struct pakfire_parser_declaration* pakfire_parser_find_declaration(
                pakfire_parser_strip_namespace(n);
        }
 
-       pakfire_free(buffer);
+       free(buffer);
 
        if (n)
-               pakfire_free(n);
+               free(n);
 
        if (!d && parser->parent)
                d = pakfire_parser_find_declaration(parser->parent, name);
@@ -406,7 +407,7 @@ PAKFIRE_EXPORT char* pakfire_parser_expand(PakfireParser parser, const char* val
                DEBUG(parser->pakfire, "New buffer: %s\n", b);
 
                // Drop old buffer
-               pakfire_free(buffer);
+               free(buffer);
                buffer = b;
        }
 
@@ -455,7 +456,7 @@ PAKFIRE_EXPORT int pakfire_parser_read(PakfireParser parser, FILE* f) {
        r = pakfire_parser_parse_data(parser, data, len);
 
        if (data)
-               pakfire_free(data);
+               free(data);
 
        return r;
 }
index b428236b3e6646a05c5d8c8b5a7cfe2095e018a7..77d01d972d7be0cc22122fdb3c1eebfdc332ccd0 100644 (file)
@@ -25,6 +25,7 @@
 
 %{
 #include <stdio.h>
+#include <stdlib.h>
 #include <time.h>
 
 #include <pakfire/constants.h>
@@ -278,7 +279,7 @@ int pakfire_parser_parse_data(PakfireParser parent, const char* data, size_t len
        char* dump = pakfire_parser_dump(parent);
 
        DEBUG(pakfire, "Status of the parser %p:\n%s\n", parent, dump);
-       pakfire_free(dump);
+       free(dump);
 
        // Log time we needed to parse data
        DEBUG(pakfire, "Parser finished in %.4fms\n",
@@ -329,8 +330,8 @@ static PakfireParser make_if_stmt(PakfireParser parser, const enum operator op,
        }
 
        pakfire_unref(pakfire);
-       pakfire_free(v1);
-       pakfire_free(v2);
+       free(v1);
+       free(v2);
 
        return result;
 }
index 54fbc228b9c36443c9a78a4e6d5f429f42cb3651..1a7aac769e1b213d3ba76c17967f29cbb407fd16 100644 (file)
@@ -26,6 +26,7 @@
 int num_lines;
 
 #include <ctype.h>
+#include <stdlib.h>
 #include <pakfire/parser.h>
 #include <pakfire/util.h>
 #include "grammar.h"
@@ -92,7 +93,7 @@ template2             {whitespace}template.*
                                                unput(buffer[i]);
                                        }
 
-                                       pakfire_free(buffer);
+                                       free(buffer);
                                }
 
 <INITIAL>^{template1}$ {
@@ -103,7 +104,7 @@ template2           {whitespace}template.*
                                                unput(buffer[i]);
                                        }
 
-                                       pakfire_free(buffer);
+                                       free(buffer);
                                }
 
 <INITIAL>^{template2}$ {
@@ -114,7 +115,7 @@ template2           {whitespace}template.*
                                                unput(buffer[i]);
                                        }
 
-                                       pakfire_free(buffer);
+                                       free(buffer);
                                }
 
 <INITIAL>^{script} {
@@ -125,7 +126,7 @@ template2           {whitespace}template.*
                                                unput(buffer[i]);
                                        }
 
-                                       pakfire_free(buffer);
+                                       free(buffer);
                                }
 
 <INITIAL>^{keywords}$ {
@@ -141,7 +142,7 @@ template2           {whitespace}template.*
                                                unput(buffer[i]);
                                        }
 
-                                       pakfire_free(buffer);
+                                       free(buffer);
                                }
 
 <INITIAL>"=="  { return T_EQUALS; }
index b48bc0d163150a4f00dbe12206236fdccb17b60e..e5234cae24da4e416896a0ab0e32e4c31fbf2528 100644 (file)
@@ -18,6 +18,8 @@
 #                                                                             #
 #############################################################################*/
 
+#include <stdlib.h>
+
 #include <pakfire/constants.h>
 #include <pakfire/i18n.h>
 #include <pakfire/logging.h>
@@ -236,10 +238,10 @@ static void pakfire_problem_free(PakfireProblem problem) {
        pakfire_request_unref(problem->request);
 
        if (problem->string)
-               pakfire_free(problem->string);
+               free(problem->string);
 
        pakfire_unref(problem->pakfire);
-       pakfire_free(problem);
+       free(problem);
 }
 
 PAKFIRE_EXPORT PakfireProblem pakfire_problem_unref(PakfireProblem problem) {
index 5ca6310b26063aae5e023491924b58c182e33ee4..8b649bf2b66304cda2c2eaf2873fe272cafbab8e 100644 (file)
@@ -19,6 +19,7 @@
 #############################################################################*/
 
 #include <assert.h>
+#include <stdlib.h>
 
 #include <solv/pooltypes.h>
 #include <solv/queue.h>
@@ -126,8 +127,8 @@ PAKFIRE_EXPORT PakfireRelation pakfire_relation_create_from_string(Pakfire pakfi
                PakfireRelation rel = pakfire_relation_create(pakfire, name, cmp2type(*delim), evr);
 
                // Cleanup
-               pakfire_free(name);
-               pakfire_free(evr);
+               free(name);
+               free(evr);
 
                return rel;
        }
@@ -146,7 +147,7 @@ static void pakfire_relation_free(PakfireRelation relation) {
        DEBUG(relation->pakfire, "Releasing Relation at %p\n", relation);
 
        pakfire_unref(relation->pakfire);
-       pakfire_free(relation);
+       free(relation);
 }
 
 PAKFIRE_EXPORT PakfireRelation pakfire_relation_unref(PakfireRelation relation) {
index 11fde75af976bf27c0df294b482e21fc66cf4c2b..0c7bf61adbac256575f76a6487a19e12239271c0 100644 (file)
@@ -19,6 +19,7 @@
 #############################################################################*/
 
 #include <errno.h>
+#include <stdlib.h>
 
 #include <solv/pooltypes.h>
 #include <solv/queue.h>
@@ -69,10 +70,10 @@ PAKFIRE_EXPORT int pakfire_relationlist_create_from_string(PakfireRelationList*
                        pakfire_relation_unref(rel);
                }
 
-               pakfire_free(*element);
+               free(*element);
        }
 
-       pakfire_free(elements);
+       free(elements);
 
        return 0;
 }
@@ -88,7 +89,7 @@ static void pakfire_relationlist_free(PakfireRelationList relationlist) {
        pakfire_unref(relationlist->pakfire);
 
        queue_free(&relationlist->queue);
-       pakfire_free(relationlist);
+       free(relationlist);
 }
 
 PAKFIRE_EXPORT PakfireRelationList pakfire_relationlist_unref(PakfireRelationList relationlist) {
index f99a8567a324aa3360484616882e7d03d86058b1..22ccb9d6e8a61a4482913320f0cc1f30db1a4256 100644 (file)
@@ -21,6 +21,7 @@
 #include <assert.h>
 #include <stdint.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include <solv/repo.h>
@@ -63,18 +64,18 @@ static void free_repo_appdata(struct pakfire_repo_appdata* appdata) {
        // repodata is being destroyed with the repository
 
        if (appdata->description)
-               pakfire_free(appdata->description);
+               free(appdata->description);
 
        if (appdata->baseurl)
-               pakfire_free(appdata->baseurl);
+               free(appdata->baseurl);
 
        if (appdata->keyfile)
-               pakfire_free(appdata->keyfile);
+               free(appdata->keyfile);
 
        if (appdata->mirrorlist)
-               pakfire_free(appdata->mirrorlist);
+               free(appdata->mirrorlist);
 
-       pakfire_free(appdata);
+       free(appdata);
 }
 
 void pakfire_repo_free_all(Pakfire pakfire) {
@@ -140,7 +141,7 @@ static void pakfire_repo_free(PakfireRepo repo) {
        DEBUG(repo->pakfire, "Releasing Repo at %p\n", repo);
        pakfire_unref(repo->pakfire);
 
-       pakfire_free(repo);
+       free(repo);
 }
 
 PAKFIRE_EXPORT PakfireRepo pakfire_repo_unref(PakfireRepo repo) {
@@ -245,7 +246,7 @@ PAKFIRE_EXPORT const char* pakfire_repo_get_description(PakfireRepo repo) {
 
 PAKFIRE_EXPORT int pakfire_repo_set_description(PakfireRepo repo, const char* description) {
        if (repo->appdata->description)
-               pakfire_free(repo->appdata->description);
+               free(repo->appdata->description);
 
        if (description)
                repo->appdata->description = pakfire_strdup(description);
@@ -282,7 +283,7 @@ PAKFIRE_EXPORT const char* pakfire_repo_get_baseurl(PakfireRepo repo) {
 
 PAKFIRE_EXPORT int pakfire_repo_set_baseurl(PakfireRepo repo, const char* baseurl) {
        if (repo->appdata->baseurl)
-               pakfire_free(repo->appdata->baseurl);
+               free(repo->appdata->baseurl);
 
        if (baseurl)
                repo->appdata->baseurl = pakfire_strdup(baseurl);
@@ -298,7 +299,7 @@ PAKFIRE_EXPORT const char* pakfire_repo_get_keyfile(PakfireRepo repo) {
 
 PAKFIRE_EXPORT int pakfire_repo_set_keyfile(PakfireRepo repo, const char* keyfile) {
        if (repo->appdata->keyfile)
-               pakfire_free(repo->appdata->keyfile);
+               free(repo->appdata->keyfile);
 
        if (keyfile)
                repo->appdata->keyfile = pakfire_strdup(keyfile);
@@ -314,7 +315,7 @@ PAKFIRE_EXPORT const char* pakfire_repo_get_mirrorlist(PakfireRepo repo) {
 
 PAKFIRE_EXPORT int pakfire_repo_set_mirrorlist(PakfireRepo repo, const char* mirrorlist) {
        if (repo->appdata->mirrorlist)
-               pakfire_free(repo->appdata->mirrorlist);
+               free(repo->appdata->mirrorlist);
 
        if (mirrorlist)
                repo->appdata->mirrorlist = pakfire_strdup(mirrorlist);
@@ -581,7 +582,7 @@ static char* pakfire_repo_make_cache_path(PakfireRepo repo, const char* path) {
 
        // Add the prefix for the repository first
        char* cache_path = pakfire_path_join(prefix, path);
-       pakfire_free(prefix);
+       free(prefix);
 
        return cache_path;
 }
@@ -599,7 +600,7 @@ PAKFIRE_EXPORT char* pakfire_repo_cache_get_path(PakfireRepo repo, const char* p
        char* repo_cache_path = pakfire_repo_make_cache_path(repo, path);
 
        char* cache_path = pakfire_get_cache_path(repo->pakfire, repo_cache_path);
-       pakfire_free(repo_cache_path);
+       free(repo_cache_path);
 
        return cache_path;
 }
@@ -608,7 +609,7 @@ PAKFIRE_EXPORT FILE* pakfire_repo_cache_open(PakfireRepo repo, const char* path,
        char* cache_path = pakfire_repo_make_cache_path(repo, path);
 
        FILE* f = pakfire_cache_open(repo->pakfire, cache_path, mode);
-       pakfire_free(cache_path);
+       free(cache_path);
 
        return f;
 }
@@ -617,7 +618,7 @@ PAKFIRE_EXPORT int pakfire_repo_cache_access(PakfireRepo repo, const char* path,
        char* cache_path = pakfire_repo_make_cache_path(repo, path);
 
        int r = pakfire_cache_access(repo->pakfire, cache_path, mode);
-       pakfire_free(cache_path);
+       free(cache_path);
 
        return r;
 }
@@ -626,7 +627,7 @@ PAKFIRE_EXPORT time_t pakfire_repo_cache_age(PakfireRepo repo, const char* path)
        char* cache_path = pakfire_repo_make_cache_path(repo, path);
 
        time_t t = pakfire_cache_age(repo->pakfire, cache_path);
-       pakfire_free(cache_path);
+       free(cache_path);
 
        return t;
 }
index df9853e5e51059c4007f775d090f2235f0bda0c0..bccc8d2e292e58f2c02ab2cfe14ed0df060942de 100644 (file)
@@ -18,6 +18,8 @@
 #                                                                             #
 #############################################################################*/
 
+#include <stdlib.h>
+
 #include <solv/queue.h>
 #include <solv/solver.h>
 #include <solv/transaction.h>
@@ -76,7 +78,7 @@ static void pakfire_request_free(PakfireRequest request) {
        queue_free(&request->queue);
 
        pakfire_unref(request->pakfire);
-       pakfire_free(request);
+       free(request);
 }
 
 PAKFIRE_EXPORT PakfireRequest pakfire_request_unref(PakfireRequest request) {
index b620bb72552a55f554c80735d7c31a553d759ef7..0659b2ffeaf0db1cdfc7ef715cc2daf59c618322 100644 (file)
@@ -19,6 +19,7 @@
 #############################################################################*/
 
 #include <assert.h>
+#include <stdlib.h>
 
 #include <solv/pool.h>
 #include <solv/queue.h>
@@ -73,7 +74,7 @@ static void pakfire_selector_free(PakfireSelector selector) {
        DEBUG(selector->pakfire, "Releasing Selector at %p\n", selector);
 
        pakfire_unref(selector->pakfire);
-       pakfire_free(selector);
+       free(selector);
 }
 
 PAKFIRE_EXPORT PakfireSelector pakfire_selector_unref(PakfireSelector selector) {
index d659eee2c803f5b00748076fff3f0399068ee764..0dc74e2bd9697460f05e089ffb03889cc24f9491 100644 (file)
@@ -19,6 +19,7 @@
 #############################################################################*/
 
 #include <assert.h>
+#include <stdlib.h>
 
 #include <solv/policy.h>
 
@@ -157,9 +158,9 @@ static void pakfire_solution_free(PakfireSolution solution) {
 
        if (solution->elements)
                while (*solution->elements)
-                       pakfire_free(*solution->elements++);
+                       free(*solution->elements++);
 
-       pakfire_free(solution);
+       free(solution);
 }
 
 PAKFIRE_EXPORT PakfireSolution pakfire_solution_unref(PakfireSolution solution) {
index 33fa1d97c16049963413725caf437bf49f68965e..307173308e730f70d4c00bafdffd8492cf03573f 100644 (file)
@@ -80,7 +80,7 @@ static void pakfire_step_free(PakfireStep step) {
        pakfire_package_unref(step->package);
        pakfire_archive_unref(step->archive);
        pakfire_unref(step->pakfire);
-       pakfire_free(step);
+       free(step);
 }
 
 PAKFIRE_EXPORT PakfireStep pakfire_step_unref(PakfireStep step) {
@@ -201,8 +201,8 @@ static int pakfire_step_verify(PakfireStep step) {
                ERROR(step->pakfire, "Could not open package archive for %s: %s\n",
                        nevra, cache_path);
 
-               pakfire_free(nevra);
-               pakfire_free(cache_path);
+               free(nevra);
+               free(cache_path);
 
                return -1;
        }
@@ -296,7 +296,7 @@ out:
        unlink(path);
 
        // Cleanup
-       pakfire_free(path);
+       free(path);
 
        return r;
 }
@@ -356,7 +356,7 @@ static int pakfire_step_extract(PakfireStep step) {
        if (r) {
                char* nevra = pakfire_package_get_nevra(step->package);
                ERROR(step->pakfire, "Could not extract package %s: %d\n", nevra, r);
-               pakfire_free(nevra);
+               free(nevra);
        }
 
        // Update the runtime linker cache
index 48363580d2053255882ca533db9258c9e16b3a1b..b1810b7c5460d69c78f754c1b5b6bbbff654033c 100644 (file)
@@ -19,6 +19,8 @@
 #############################################################################*/
 
 #include <assert.h>
+#include <stdlib.h>
+
 #include <solv/transaction.h>
 
 #include <pakfire/db.h>
@@ -134,7 +136,7 @@ void pakfire_transaction_free(PakfireTransaction transaction) {
                pakfire_step_unref(*transaction->steps++);
 
        transaction_free(transaction->transaction);
-       pakfire_free(transaction);
+       free(transaction);
 }
 
 PAKFIRE_EXPORT PakfireTransaction pakfire_transaction_unref(PakfireTransaction transaction) {
@@ -244,7 +246,7 @@ static void pakfire_transaction_add_package(char** str, size_t width, PakfirePac
        );
 
        pakfire_repo_unref(repo);
-       pakfire_free(size_str);
+       free(size_str);
 }
 
 static void pakfire_transaction_add_separator(char** str, size_t width) {
@@ -293,7 +295,7 @@ static void pakfire_transaction_add_usage_line(char** str, size_t width, const c
 
        asprintf(str, "%s%-21s: %s\n", *str, headline, s);
 
-       pakfire_free(s);
+       free(s);
 }
 
 PAKFIRE_EXPORT char* pakfire_transaction_dump(PakfireTransaction transaction, size_t width) {
index 8abcffdb1d261a7b45cbf9e1646cc878485e8e78..d3a2dca97d6ce23400fc86bd0e39b0caab9932d5 100644 (file)
@@ -75,13 +75,6 @@ void* pakfire_realloc(void* ptr, size_t size) {
        return ptr;
 }
 
-PAKFIRE_EXPORT void* pakfire_free(void* mem) {
-       if (mem)
-               free(mem);
-
-       return 0;
-}
-
 char* pakfire_strdup(const char* s) {
        if (!s)
                return 0;
@@ -173,7 +166,7 @@ PAKFIRE_EXPORT char* pakfire_basename(const char* path) {
        if (r)
                r = pakfire_strdup(r);
 
-       pakfire_free(name);
+       free(name);
 
        return r;
 }
@@ -185,7 +178,7 @@ PAKFIRE_EXPORT char* pakfire_dirname(const char* path) {
        if (r)
                r = pakfire_strdup(r);
 
-       pakfire_free(parent);
+       free(parent);
 
        return r;
 }
@@ -209,7 +202,7 @@ PAKFIRE_EXPORT int pakfire_access(Pakfire pakfire, const char* dir, const char*
                        DEBUG(pakfire, "%s does not exist\n", path);
        }
 
-       pakfire_free(path);
+       free(path);
 
        return r;
 }
@@ -226,7 +219,7 @@ int pakfire_mkdir(Pakfire pakfire, const char* path, mode_t mode) {
        if (r)
                r = pakfire_mkdir(pakfire, parent, 0);
 
-       pakfire_free(parent);
+       free(parent);
 
        // Exit if parent directory could not be created
        if (r)
@@ -327,7 +320,7 @@ PAKFIRE_EXPORT int pakfire_read_file_into_buffer(FILE* f, char** buffer, size_t*
        // Check we encountered any errors
        r = ferror(f);
        if (r) {
-               pakfire_free(*buffer);
+               free(*buffer);
                return r;
        }
 
index e3b71047fcac16978e9a6ddd84f607436d3846a1..6ddd1853a7365f0d579917b81e9bde6de46c4a50 100644 (file)
@@ -18,6 +18,7 @@
 #                                                                             #
 #############################################################################*/
 
+#include <stdlib.h>
 #include <unistd.h>
 
 #include <pakfire/archive.h>
@@ -43,7 +44,7 @@ static int test_open(const struct test* t) {
        ASSERT(verify == PAKFIRE_ARCHIVE_VERIFY_OK);
 
        pakfire_archive_unref(archive);
-       pakfire_free(path);
+       free(path);
 
        return EXIT_SUCCESS;
 }
@@ -74,7 +75,7 @@ static int test_extract(const struct test* t) {
        char* path = pakfire_path_join(TEST_SRC_PATH, TEST_PKG1_PATH);
 
        PakfireArchive archive = pakfire_archive_open(t->pakfire, path);
-       pakfire_free(path);
+       free(path);
 
        // Extract the archive payload
        int r = pakfire_archive_extract(archive, NULL, PAKFIRE_ARCHIVE_USE_PAYLOAD);
@@ -93,7 +94,7 @@ static int test_import(const struct test* t) {
        char* path = pakfire_path_join(TEST_SRC_PATH, TEST_PKG1_PATH);
 
        PakfireArchive archive = pakfire_archive_open(t->pakfire, path);
-       pakfire_free(path);
+       free(path);
 
        PakfireRepo repo = pakfire_repo_create(t->pakfire, "tmp");
        ASSERT(repo);
index d434f532be8a60671c11bf8c27769aaf50572f77..3905f0fac840a4cf07bdfce32a2ba7927ec9e1c0 100644 (file)
@@ -18,6 +18,7 @@
 #                                                                             #
 #############################################################################*/
 
+#include <stdlib.h>
 #include <string.h>
 
 #include <pakfire/key.h>
@@ -73,14 +74,14 @@ static int test_import_export(const struct test* t) {
        char* dump = pakfire_key_dump(key);
        ASSERT(dump);
        LOG("%s\n", dump);
-       pakfire_free(dump);
+       free(dump);
 
        // Export the key
        char* data = pakfire_key_export(key, 0);
        ASSERT(data);
 
        LOG("Exported key:\n%s\n", data);
-       pakfire_free(data);
+       free(data);
 
        pakfire_key_unref(key);
 
index 02205b0c09e946ab56cf9e0e48102768b7df1d4a..c0b839a9327508a3b79a8a0f0ab2f3b191e85a05 100644 (file)
@@ -18,6 +18,7 @@
 #                                                                             #
 #############################################################################*/
 
+#include <stdlib.h>
 #include <string.h>
 
 #include <pakfire/parser.h>
@@ -42,10 +43,10 @@ static int test_parse(const struct test* t) {
        ASSERT(value);
 
        printf("VALUE: sources = %s\n", value);
-       pakfire_free(value);
+       free(value);
 
        // Cleanup
-       pakfire_free(path);
+       free(path);
 
        pakfire_parser_unref(parser);
 
index cb23b2fede574b133e5acd68e6adc3125bc22c6f..941cb41bcc1a7fe29b63b55792247fb8d572f787 100644 (file)
@@ -18,6 +18,7 @@
 #                                                                             #
 #############################################################################*/
 
+#include <stdlib.h>
 #include <string.h>
 
 #include <pakfire/parser.h>
@@ -97,7 +98,7 @@ static int test_parser(const struct test* t) {
        // Cleanup
        pakfire_parser_unref(subparser);
        pakfire_parser_unref(parser);
-       pakfire_free(value);
+       free(value);
 
        return EXIT_SUCCESS;
 }
index 5021801a43cc7c9bbca98caf4851e13f186f5566..b8ee61d41a4dbee92969eaf651329b4cef073cdf 100644 (file)
@@ -18,6 +18,7 @@
 #                                                                             #
 #############################################################################*/
 
+#include <stdlib.h>
 #include <string.h>
 
 #include <pakfire/parser.h>
@@ -30,7 +31,7 @@ static int test_basename(const struct test* t) {
 
        char* output = pakfire_basename(dir);
        ASSERT_STRING_EQUALS(output, "c");
-       pakfire_free(output);
+       free(output);
 
        return EXIT_SUCCESS;
 }
@@ -40,7 +41,7 @@ static int test_dirname(const struct test* t) {
 
        char* output = pakfire_dirname(dir);
        ASSERT_STRING_EQUALS(output, "/a/b");
-       pakfire_free(output);
+       free(output);
 
        return EXIT_SUCCESS;
 }