Skip to content

Commit

Permalink
Fix more leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
TanmayPatil105 committed Jun 13, 2024
1 parent 93f41a5 commit 85a1d57
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,9 @@ find_image_uri (char *content)

//FIXME: extract title
static char*
find_image_title ()
find_image_title (char *content)
{
free (content);
return NULL;
}

Expand All @@ -298,8 +299,8 @@ read_md_unit (char *line,

if (unit->type == UNIT_TYPE_IMAGE)
{
unit->uri = find_image_uri (unit->content);
unit->content = find_image_title ();
unit->uri = strdup (find_image_uri (unit->content));
unit->content = find_image_title (unit->content);
}

/* Append to md->elements */
Expand Down Expand Up @@ -366,13 +367,12 @@ md_free (MD *md)
next = unit->next;
if (unit->content != NULL)
free (unit->content);
if (unit->uri != NULL)
free (unit->uri);

free (unit);
unit = next;
}

if (unit->uri != NULL)
free (unit->uri);

free (md);
}

0 comments on commit 85a1d57

Please sign in to comment.