Due to deb_extract's defect that I cannot tell if an extraction is
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Thu, 26 Mar 2009 17:57:23 +0000 (17:57 +0000)
committerticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Thu, 26 Mar 2009 17:57:23 +0000 (17:57 +0000)
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

libopkg/pkg_extract.c

index 0aae4ad578d6b3bb6ca4dd6b532d688c394f42ce..7f22ff32db8401f996a0cd3d1e353fb6a3ea5897 100644 (file)
@@ -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;
 }