Coder Social home page Coder Social logo

No deep copy of `as_config_s` in `aerospike_init` after making `hosts` member as a pointer instead of C-array in commit 6b5a82f8 about aerospike-client-c HOT 7 CLOSED

aerospike avatar aerospike commented on June 4, 2024
No deep copy of `as_config_s` in `aerospike_init` after making `hosts` member as a pointer instead of C-array in commit 6b5a82f8

from aerospike-client-c.

Comments (7)

djc avatar djc commented on June 4, 2024

Ping! This seems like an obvious bug in the client C libraries, please review the material.

from aerospike-client-c.

BrianNichols avatar BrianNichols commented on June 4, 2024

We will fix this bug in the next release.

from aerospike-client-c.

djc avatar djc commented on June 4, 2024

@BrianNichols that's good to hear. Do you have an approximate ETA for this?

from aerospike-client-c.

BrianNichols avatar BrianNichols commented on June 4, 2024

The C client is released approximately once per month, so it should be released by the end of this month.

In the meantime, don't call as_config_destroy() because as_cluster_create() transfers ownership of hosts and cluster_id to as_cluster. The client will not leak memory if as_cluster_create() is successful.

from aerospike-client-c.

BrianNichols avatar BrianNichols commented on June 4, 2024

This problem will be fixed by making as_config_destroy() a private function. First, all dynamically allocated as_config variables will be copied using setter functions. When aerospike_init() is called, the client will assume ownership of all config fields. When aerospike_destroy() is called, as_config_destroy() will be internally called.

The user should not call as_config_destroy() directly.

from aerospike-client-c.

eldar-activevideo avatar eldar-activevideo commented on June 4, 2024

Thank you for update!

I suggest to make transferring of ownership in aerospike_init more explicit for user because currently it's not obvious that aerospike_init takes ownership of as_config object.

from aerospike-client-c.

BrianNichols avatar BrianNichols commented on June 4, 2024

C client 4.1.1 has been released.

http://www.aerospike.com/download/client/c/4.1.1/

from aerospike-client-c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.