apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r590524 - /apr/apr-util/trunk/dbd/apr_dbd_oracle.c
Date Wed, 31 Oct 2007 00:47:14 GMT
Author: bojan
Date: Tue Oct 30 17:47:13 2007
New Revision: 590524

URL: http://svn.apache.org/viewvc?rev=590524&view=rev
Log:
Careful, error may be NULL

Modified:
    apr/apr-util/trunk/dbd/apr_dbd_oracle.c

Modified: apr/apr-util/trunk/dbd/apr_dbd_oracle.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_oracle.c?rev=590524&r1=590523&r2=590524&view=diff
==============================================================================
--- apr/apr-util/trunk/dbd/apr_dbd_oracle.c (original)
+++ apr/apr-util/trunk/dbd/apr_dbd_oracle.c Tue Oct 30 17:47:13 2007
@@ -522,9 +522,11 @@
         printf("OPEN ERROR %d (alloc svr): %s\n", ret->status, ret->buf);
         break;
 #else
-        *error = apr_pcalloc(pool, ERR_BUF_SIZE);
-        OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
-                    ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        if (error) {
+            *error = apr_pcalloc(pool, ERR_BUF_SIZE);
+            OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
+                        ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        }
         return NULL;
 #endif
     case OCI_SUCCESS:
@@ -541,9 +543,11 @@
         printf("OPEN ERROR %d (alloc svc): %s\n", ret->status, ret->buf);
         break;
 #else
-        *error = apr_pcalloc(pool, ERR_BUF_SIZE);
-        OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
-                    ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        if (error) {
+            *error = apr_pcalloc(pool, ERR_BUF_SIZE);
+            OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
+                        ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        }
         return NULL;
 #endif
     case OCI_SUCCESS:
@@ -564,9 +568,11 @@
         printf("OPEN ERROR: %s\n", ret->buf);
         break;
 #else
-        *error = apr_pcalloc(pool, ERR_BUF_SIZE);
-        OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
-                    ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        if (error) {
+            *error = apr_pcalloc(pool, ERR_BUF_SIZE);
+            OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
+                        ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        }
         return NULL;
 #endif
     case OCI_SUCCESS:
@@ -583,9 +589,11 @@
         printf("OPEN ERROR %d (server attach): %s\n", ret->status, ret->buf);
         break;
 #else
-        *error = apr_pcalloc(pool, ERR_BUF_SIZE);
-        OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
-                    ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        if (error) {
+            *error = apr_pcalloc(pool, ERR_BUF_SIZE);
+            OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
+                        ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        }
         return NULL;
 #endif
     case OCI_SUCCESS:
@@ -601,9 +609,11 @@
         printf("OPEN ERROR %d (attr set): %s\n", ret->status, ret->buf);
         break;
 #else
-        *error = apr_pcalloc(pool, ERR_BUF_SIZE);
-        OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
-                    ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        if (error) {
+            *error = apr_pcalloc(pool, ERR_BUF_SIZE);
+            OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
+                        ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        }
         return NULL;
 #endif
     case OCI_SUCCESS:
@@ -619,9 +629,11 @@
         printf("OPEN ERROR %d (alloc auth): %s\n", ret->status, ret->buf);
         break;
 #else
-        *error = apr_pcalloc(pool, ERR_BUF_SIZE);
-        OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
-                    ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        if (error) {
+            *error = apr_pcalloc(pool, ERR_BUF_SIZE);
+            OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
+                        ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        }
         return NULL;
 #endif
     case OCI_SUCCESS:
@@ -637,9 +649,11 @@
         printf("OPEN ERROR %d (attr username): %s\n", ret->status, ret->buf);
         break;
 #else
-        *error = apr_pcalloc(pool, ERR_BUF_SIZE);
-        OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
-                    ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        if (error) {
+            *error = apr_pcalloc(pool, ERR_BUF_SIZE);
+            OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
+                        ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        }
         return NULL;
 #endif
     case OCI_SUCCESS:
@@ -655,9 +669,11 @@
         printf("OPEN ERROR %d (attr password): %s\n", ret->status, ret->buf);
         break;
 #else
-        *error = apr_pcalloc(pool, ERR_BUF_SIZE);
-        OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
-                    ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        if (error) {
+            *error = apr_pcalloc(pool, ERR_BUF_SIZE);
+            OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
+                        ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        }
         return NULL;
 #endif
     case OCI_SUCCESS:
@@ -673,9 +689,11 @@
         printf("OPEN ERROR %d (session begin): %s\n", ret->status, ret->buf);
         break;
 #else
-        *error = apr_pcalloc(pool, ERR_BUF_SIZE);
-        OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
-                    ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        if (error) {
+            *error = apr_pcalloc(pool, ERR_BUF_SIZE);
+            OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
+                        ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        }
         return NULL;
 #endif
     case OCI_SUCCESS:
@@ -690,9 +708,11 @@
                     sizeof(ret->buf), OCI_HTYPE_ERROR);
         printf("OPEN ERROR %d (attr session): %s\n", ret->status, ret->buf);
 #else
-        *error = apr_pcalloc(pool, ERR_BUF_SIZE);
-        OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
-                    ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        if (error) {
+            *error = apr_pcalloc(pool, ERR_BUF_SIZE);
+            OCIErrorGet(ret->err, 1, NULL, &errorcode, (unsigned char*)(*error),
+                        ERR_BUF_SIZE, OCI_HTYPE_ERROR);
+        }
         return NULL;
 #endif
         break;



Mime
View raw message