Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in the comment management #1778

Closed
sssd-bot opened this issue May 2, 2020 · 0 comments
Closed

Memory leak in the comment management #1778

sssd-bot opened this issue May 2, 2020 · 0 comments
Labels
Closed: Fixed Issue was closed as fixed.

Comments

@sssd-bot
Copy link

sssd-bot commented May 2, 2020

Cloned from Pagure issue: https://pagure.io/SSSD/sssd/issue/736

  • Created at 2010-12-17 01:21:08 by dpal
  • Closed as Fixed
  • Assigned to nobody

In ini/ini_comment.c

The check is incorrect.

         case INI_COMMENT_MODE_INSERT:
  288
  289        TRACE_INFO_STRING("Insert mode", "");
  290        len = ref_array_len(ic->ra);
  291        if (idx > len) {
  292            /* Fill in empty lines */
  293            for (i = 0; i < (idx-len); i++) {
Calling allocation function "calloc".
Assigning: "empty" = storage returned from "calloc(1UL, 1UL)".
  294                empty = strdup("");
At conditional (1): "empty" taking the true branch.
  295                if (empty) {
  296                    TRACE_ERROR_NUMBER("Memory problem", ENOMEM);
Variable "empty" going out of scope leaks the storage it points to.
  297                    return ENOMEM;
  298                }
  299                error = ref_array_append(ic->ra, (void *)&empty);
  300                if (error) {
  301                    TRACE_ERROR_NUMBER("Append problem", error);
  302                    free(empty);
  303                    return error;
  304                }
  305                error = ref_array_append(ic->ra_len, (void *)&input_len);
  306                if (error) {
  307                    TRACE_ERROR_NUMBER("Error adding lenghts", error);
  308                    free(empty);
  309                    return error;
  310                }

Comments


Comment from dpal at 2010-12-17 01:21:33

Fields changed

summary: Memory leak in the comment managment => Memory leak in the comment management


Comment from dpal at 2010-12-17 01:21:33

Fields changed

summary: Memory leak in the comment managment => Memory leak in the comment management


Comment from dpal at 2010-12-17 01:21:33

Fields changed

summary: Memory leak in the comment managment => Memory leak in the comment management


Comment from sgallagh at 2010-12-17 14:27:33

Fields changed

coverity: => 10041
keywords: => Coverity


Comment from sgallagh at 2010-12-17 14:27:33

Fields changed

coverity: => 10041
keywords: => Coverity


Comment from sgallagh at 2010-12-17 14:27:33

Fields changed

coverity: => 10041
keywords: => Coverity


Comment from dpal at 2010-12-24 05:15:46

This code is fixed on master. It is Ok to ignore it on the release branch since this code path is not executed yet.


Comment from dpal at 2010-12-24 05:15:46

This code is fixed on master. It is Ok to ignore it on the release branch since this code path is not executed yet.


Comment from dpal at 2010-12-24 05:15:46

This code is fixed on master. It is Ok to ignore it on the release branch since this code path is not executed yet.


Comment from dpal at 2010-12-24 05:16:06

Fields changed

resolution: => fixed
status: new => closed


Comment from dpal at 2010-12-24 05:16:06

Fields changed

resolution: => fixed
status: new => closed


Comment from dpal at 2010-12-24 05:16:06

Fields changed

resolution: => fixed
status: new => closed


Comment from dpal at 2012-01-19 03:26:12

Fields changed

rhbz: => 0


Comment from dpal at 2012-01-19 03:26:12

Fields changed

rhbz: => 0


Comment from dpal at 2012-01-19 03:26:12

Fields changed

rhbz: => 0


Comment from dpal at 2017-02-24 15:08:10

Metadata Update from @dpal:

  • Issue set to the milestone: Tools Backlog
@sssd-bot sssd-bot added the Closed: Fixed Issue was closed as fixed. label May 2, 2020
@sssd-bot sssd-bot closed this as completed May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed: Fixed Issue was closed as fixed.
Projects
None yet
Development

No branches or pull requests

1 participant