From 02a11ed08cc337610335d95af3f1c0d666513b53 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 19 Jun 2013 09:20:44 +0200 Subject: [PATCH] xbps-rindex: add: remove unused headers; prop_array_count checks for NULL pointers. --- bin/xbps-rindex/index-add.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/xbps-rindex/index-add.c b/bin/xbps-rindex/index-add.c index 72454570..3bf1b89b 100644 --- a/bin/xbps-rindex/index-add.c +++ b/bin/xbps-rindex/index-add.c @@ -35,8 +35,6 @@ #include #include -#include -#include #include "defs.h" /* @@ -212,19 +210,19 @@ index_add(struct xbps_handle *xhp, int argc, char **argv, bool force) /* Find out if binary pkg stored in index contain any file */ pkg_cffiles = prop_dictionary_get(newpkgfilesd, "conf_files"); - if (pkg_cffiles != NULL && prop_array_count(pkg_cffiles)) + if (prop_array_count(pkg_cffiles)) found = true; else pkg_cffiles = NULL; pkg_files = prop_dictionary_get(newpkgfilesd, "files"); - if (pkg_files != NULL && prop_array_count(pkg_files)) + if (prop_array_count(pkg_files)) found = true; else pkg_files = NULL; pkg_links = prop_dictionary_get(newpkgfilesd, "links"); - if (pkg_links != NULL && prop_array_count(pkg_links)) + if (prop_array_count(pkg_links)) found = true; else pkg_links = NULL; @@ -288,6 +286,7 @@ index_add(struct xbps_handle *xhp, int argc, char **argv, bool force) prop_dictionary_count(idx)); printf("index-files: %u packages registered.\n", prop_dictionary_count(idxfiles)); + prop_object_release(idx); prop_object_release(idxfiles);