]> granicus.if.org Git - apache/commitdiff
No need to test for NULL before calling apr_pstrdup.
authorChristophe Jaillet <jailletc36@apache.org>
Sun, 14 Oct 2012 06:54:36 +0000 (06:54 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Sun, 14 Oct 2012 06:54:36 +0000 (06:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1398025 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/mod_autoindex.c
modules/lua/lua_vmprep.c
modules/ssl/ssl_engine_vars.c
server/error_bucket.c

index 40ff56a4bfd6cb50524819284d7d1443a58ca340..bfcd8114f668a42becbdc6dec67e66d193f8fa9e 100644 (file)
@@ -207,7 +207,7 @@ static void push_item(apr_array_header_t *arr, char *type, const char *to,
     }
 
     p->type = type;
-    p->data = data ? apr_pstrdup(arr->pool, data) : NULL;
+    p->data = apr_pstrdup(arr->pool, data);
     p->apply_path = apr_pstrcat(arr->pool, path, "*", NULL);
 
     if ((type == BY_PATH) && (!ap_is_matchexp(to))) {
index 91c7d9c757f7868276982ff4087dd727af989a86..b22473d86792a7501fcbf223d637f967e4b2cc9a 100644 (file)
@@ -356,10 +356,10 @@ static ap_lua_vm_spec* copy_vm_spec(apr_pool_t* pool, ap_lua_vm_spec* spec)
 {
     ap_lua_vm_spec* copied_spec = apr_pcalloc(pool, sizeof(ap_lua_vm_spec));
     copied_spec->bytecode_len = spec->bytecode_len;
-    copied_spec->bytecode = spec->bytecode ? apr_pstrdup(pool, spec->bytecode) : 0;
+    copied_spec->bytecode = apr_pstrdup(pool, spec->bytecode);
     copied_spec->cb = spec->cb;
     copied_spec->cb_arg = NULL;
-    copied_spec->file = spec->file ? apr_pstrdup(pool, spec->file) : 0;
+    copied_spec->file = apr_pstrdup(pool, spec->file);
     copied_spec->package_cpaths = apr_array_copy(pool, spec->package_cpaths);
     copied_spec->package_paths = apr_array_copy(pool, spec->package_paths);
     copied_spec->pool = pool;
index 8af1c2610a235a34aea3e031e837985f41664ecf..536e6b1f73cae22f7a3aa699b73235e7b728e3d3 100644 (file)
@@ -508,7 +508,7 @@ static char *ssl_var_lookup_ssl_cert(apr_pool_t *p, request_rec *r, X509 *xs,
         result = ssl_var_lookup_ssl_cert_PEM(p, xs);
     }
 
-    if (result != NULL && resdup)
+    if (resdup)
         result = apr_pstrdup(p, result);
     return result;
 }
index d113c171a8dece1fd2993ee8921d74e1f329d762..9c118e6144b56dc30adae16f87b4caea42e872b9 100644 (file)
@@ -45,7 +45,7 @@ AP_DECLARE(apr_bucket *) ap_bucket_error_make(apr_bucket *b, int error,
 
     h = apr_bucket_alloc(sizeof(*h), b->list);
     h->status = error;
-    h->data = (buf) ? apr_pstrdup(p, buf) : NULL;
+    h->data = apr_pstrdup(p, buf);
 
     b = apr_bucket_shared_make(b, h, 0, 0);
     b->type = &ap_bucket_type_error;