瀏覽代碼

Schema Reload crash fix

In reference to ticket 302.  Forget to allocate the task_data.
Mark Reynolds 13 年之前
父節點
當前提交
6bf6e79201
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      ldap/servers/plugins/schema_reload/schema_reload.c

+ 8 - 0
ldap/servers/plugins/schema_reload/schema_reload.c

@@ -257,6 +257,14 @@ schemareload_add(Slapi_PBlock *pb, Slapi_Entry *e,
         goto out;
     }
 
+    mytaskdata = (task_data*)slapi_ch_malloc(sizeof(task_data));
+    if (mytaskdata == NULL)
+    {
+        *returncode = LDAP_OPERATIONS_ERROR;
+        rv = SLAPI_DSE_CALLBACK_ERROR;
+        goto out;
+    }
+
     mytaskdata->schemadir = slapi_ch_strdup(schemadir);
     mytaskdata->bind_dn = slapi_ch_strdup(bind_dn);