diff options
| author | Alan Third | 2020-09-01 19:53:01 +0100 |
|---|---|---|
| committer | Alan Third | 2020-09-03 20:53:28 +0100 |
| commit | aff58e3f03d44f48ceba48f75414ab687de4eec7 (patch) | |
| tree | 8291476de2208d58cd8f222930679e305eeef6f9 /src | |
| parent | c47be1b8440883b07b6cf918235a13b65e3d7be6 (diff) | |
| download | emacs-aff58e3f03d44f48ceba48f75414ab687de4eec7.tar.gz emacs-aff58e3f03d44f48ceba48f75414ab687de4eec7.zip | |
* src/image.c (svg_load_image): Use xmalloc and xfree. (bug#43135)
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/image.c b/src/image.c index 35c5946c72f..d8c34669cc4 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -9830,7 +9830,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents, | |||
| 9830 | img->background_valid = 1; | 9830 | img->background_valid = 1; |
| 9831 | } | 9831 | } |
| 9832 | 9832 | ||
| 9833 | wrapped_contents = malloc (buffer_size); | 9833 | wrapped_contents = xmalloc (buffer_size); |
| 9834 | 9834 | ||
| 9835 | if (!wrapped_contents | 9835 | if (!wrapped_contents |
| 9836 | || buffer_size <= snprintf (wrapped_contents, buffer_size, wrapper, | 9836 | || buffer_size <= snprintf (wrapped_contents, buffer_size, wrapper, |
| @@ -9889,7 +9889,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents, | |||
| 9889 | pixbuf = rsvg_handle_get_pixbuf (rsvg_handle); | 9889 | pixbuf = rsvg_handle_get_pixbuf (rsvg_handle); |
| 9890 | if (!pixbuf) goto rsvg_error; | 9890 | if (!pixbuf) goto rsvg_error; |
| 9891 | g_object_unref (rsvg_handle); | 9891 | g_object_unref (rsvg_handle); |
| 9892 | free (wrapped_contents); | 9892 | xfree (wrapped_contents); |
| 9893 | 9893 | ||
| 9894 | /* Extract some meta data from the svg handle. */ | 9894 | /* Extract some meta data from the svg handle. */ |
| 9895 | width = gdk_pixbuf_get_width (pixbuf); | 9895 | width = gdk_pixbuf_get_width (pixbuf); |
| @@ -9960,7 +9960,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents, | |||
| 9960 | if (rsvg_handle) | 9960 | if (rsvg_handle) |
| 9961 | g_object_unref (rsvg_handle); | 9961 | g_object_unref (rsvg_handle); |
| 9962 | if (wrapped_contents) | 9962 | if (wrapped_contents) |
| 9963 | free (wrapped_contents); | 9963 | xfree (wrapped_contents); |
| 9964 | /* FIXME: Use error->message so the user knows what is the actual | 9964 | /* FIXME: Use error->message so the user knows what is the actual |
| 9965 | problem with the image. */ | 9965 | problem with the image. */ |
| 9966 | image_error ("Error parsing SVG image `%s'", img->spec); | 9966 | image_error ("Error parsing SVG image `%s'", img->spec); |