gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: mark parameter as const; free co


From: gnunet
Subject: [taler-exchange] branch master updated: mark parameter as const; free correct object
Date: Mon, 02 Jan 2023 17:47:10 +0100

This is an automated email from the git hooks/post-receive script.

oec pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 8e6b0867 mark parameter as const; free correct object
8e6b0867 is described below

commit 8e6b086753d66f838a2cbdd207691c1fc5fb3a88
Author: Özgür Kesim <oec-taler@kesim.org>
AuthorDate: Mon Jan 2 17:47:06 2023 +0100

    mark parameter as const; free correct object
---
 src/exchange/taler-exchange-httpd_extensions.c   | 6 +++---
 src/extensions/age_restriction/age_restriction.c | 5 ++---
 src/extensions/extensions.c                      | 4 ++--
 src/include/taler_extensions.h                   | 8 ++++----
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_extensions.c 
b/src/exchange/taler-exchange-httpd_extensions.c
index c89a0041..ecced1fd 100644
--- a/src/exchange/taler-exchange-httpd_extensions.c
+++ b/src/exchange/taler-exchange-httpd_extensions.c
@@ -118,14 +118,14 @@ extension_update_event_cb (void *cls,
                   err.text,
                   err.source);
       GNUNET_break (0);
-      free (manifest_js);
+      free (manifest_str);
       return;
     }
 
     // Call the parser for the extension
     ret = extension->load_config (
-      (struct TALER_Extension *) extension,
-      json_object_get (manifest_js, "config"));
+      json_object_get (manifest_js, "config"),
+      (struct TALER_Extension *) extension);
 
     if (GNUNET_OK != ret)
     {
diff --git a/src/extensions/age_restriction/age_restriction.c 
b/src/extensions/age_restriction/age_restriction.c
index cc98aadb..2d6d0cbd 100644
--- a/src/extensions/age_restriction/age_restriction.c
+++ b/src/extensions/age_restriction/age_restriction.c
@@ -64,8 +64,8 @@ age_restriction_disable (
  */
 static enum GNUNET_GenericReturnValue
 age_restriction_load_config (
-  struct TALER_Extension *ext,
-  json_t *jconfig)
+  const json_t *jconfig,
+  struct TALER_Extension *ext)
 {
   struct TALER_AgeMask mask = {0};
   enum GNUNET_GenericReturnValue ret;
@@ -93,7 +93,6 @@ age_restriction_load_config (
 
   ext->config = &AR_config;
   ext->enabled = true;
-  json_decref (jconfig);
 
   GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
               "loaded new age restriction config with age groups: %s\n",
diff --git a/src/extensions/extensions.c b/src/extensions/extensions.c
index c7d80717..fc361e08 100644
--- a/src/extensions/extensions.c
+++ b/src/extensions/extensions.c
@@ -334,12 +334,12 @@ TALER_extensions_load_manifests (
     if (critical != extension->critical
         || 0 != strcmp (version, extension->version) // TODO: libtool compare?
         || NULL == config
-        || GNUNET_OK != extension->load_config (NULL, config))
+        || GNUNET_OK != extension->load_config (config, NULL))
       return GNUNET_SYSERR;
 
     /* This _should_ work now */
     if (GNUNET_OK !=
-        extension->load_config (extension, config))
+        extension->load_config (config, extension))
       return GNUNET_SYSERR;
 
     extension->enabled = true;
diff --git a/src/include/taler_extensions.h b/src/include/taler_extensions.h
index fedc17d9..bd5b7248 100644
--- a/src/include/taler_extensions.h
+++ b/src/include/taler_extensions.h
@@ -128,13 +128,13 @@ struct TALER_Extension
    * @brief Handler to read an extension-specific configuration in JSON
    * encoding and enable the extension.  Must be implemented by the extension.
    *
-   * @param ext The extension object. If NULL, the configuration will only be 
checked.
-   * @param config A JSON blob
+   * @param[in] ext The extension object. If NULL, the configuration will only 
be checked.
+   * @param[in,out] config A JSON blob
    * @return GNUNET_OK if the json was a valid configuration for the extension.
    */
   enum GNUNET_GenericReturnValue (*load_config)(
-    struct TALER_Extension *ext,
-    json_t *config);
+    const json_t *config,
+    struct TALER_Extension *ext);
 
   /**
    * @brief Handler to return the manifest of the extension in JSON encoding.

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]