[78229] trunk/base/src/cregistry/entry.c

jmr at macports.org jmr at macports.org
Thu Apr 28 20:15:32 PDT 2011


Revision: 78229
          http://trac.macports.org/changeset/78229
Author:   jmr at macports.org
Date:     2011-04-28 20:15:29 -0700 (Thu, 28 Apr 2011)
Log Message:
-----------
check for null function pointers in reg_all_objects

Modified Paths:
--------------
    trunk/base/src/cregistry/entry.c

Modified: trunk/base/src/cregistry/entry.c
===================================================================
--- trunk/base/src/cregistry/entry.c	2011-04-29 02:42:44 UTC (rev 78228)
+++ trunk/base/src/cregistry/entry.c	2011-04-29 03:15:29 UTC (rev 78229)
@@ -428,7 +428,7 @@
     int result_count = 0;
     int result_space = 10;
     sqlite3_stmt* stmt = NULL;
-    if (!results) {
+    if (!results || !fn) {
         return -1;
     }
     if (sqlite3_prepare(reg->db, query, query_len, &stmt, NULL) == SQLITE_OK) {
@@ -458,7 +458,7 @@
         if (r == SQLITE_DONE) {
             *objects = results;
             return result_count;
-        } else {
+        } else if (del) {
             int i;
             for (i=0; i<result_count; i++) {
                 del(NULL, results[i]);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110428/168ef52b/attachment.html>


More information about the macports-changes mailing list