Skip to content

Get rid of static "zero" coefficient in coefficient.c #11

@dddejan

Description

@dddejan

Leads to leak reports when using as a library

static coefficient_t zero;
static int zero_initialized = 0;

static const coefficient_t* get_zero() {
  if (!zero_initialized) {
    zero_initialized = 1;
    zero.type = COEFFICIENT_NUMERIC;
    integer_construct(&zero.value.num);
  }
  return &zero;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions