From 897c4599befe8d8d8afd6222d34d1d9229f15f61 Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Thu, 26 Mar 2009 13:57:23 -0400 Subject: Due to deb_extract's defect that I cannot tell if an extraction is successfull or failed via the return value. Therefore I cannot use it as error message. revert some code of R206 git-svn-id: http://opkg.googlecode.com/svn/trunk@208 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'libopkg/pkg_extract.c') diff --git a/libopkg/pkg_extract.c b/libopkg/pkg_extract.c index 0aae4ad..7f22ff3 100644 --- a/libopkg/pkg_extract.c +++ b/libopkg/pkg_extract.c @@ -65,10 +65,12 @@ int pkg_extract_control_files_to_dir_with_prefix(pkg_t *pkg, free(dir_with_prefix); - if (buffer == NULL) { - return EINVAL; + /* BUG: How do we know if deb_extract worked or not? This is a + defect in the current deb_extract from what I can tell. */ + + if (buffer) { + free(buffer); } - free(buffer); return 0; } @@ -81,10 +83,12 @@ int pkg_extract_data_files_to_dir(pkg_t *pkg, const char *dir) | extract_unconditional, dir, NULL); - if (buffer == NULL) { - return EINVAL; + /* BUG: How do we know if deb_extract worked or not? This is a + defect in the current deb_extract from what I can tell. */ + + if (buffer) { + free(buffer); } - free(buffer); return 0; } @@ -170,9 +174,8 @@ int pkg_extract_data_file_names_to_stream(pkg_t *pkg, FILE *file) /* BUG: How do we know if deb_extract worked or not? This is a defect in the current deb_extract from what I can tell. */ - if (buffer == NULL) { - return EINVAL; + if (buffer) { + free(buffer); } - free(buffer); return 0; } -- cgit v0.9.1