diff options
| author | Dmitry Antipov | 2014-07-04 06:28:54 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-07-04 06:28:54 +0400 |
| commit | 9d7b0167fdd06638e019103ef1b77e5956d7fb7b (patch) | |
| tree | a086d81baec06b2656eb96437935632d1862d497 /src/xselect.c | |
| parent | 2b13ca4d11960fe1d8b858a64864d7b74bf60867 (diff) | |
| download | emacs-9d7b0167fdd06638e019103ef1b77e5956d7fb7b.tar.gz emacs-9d7b0167fdd06638e019103ef1b77e5956d7fb7b.zip | |
* font.h (struct font_driver): Remove get_outline and free_outline;
not used by any font driver.
* ftfont.c (ftfont_driver):
* macfont.m (macfont_driver):
* nsfont.m (nsfont_driver):
* w32font.c (w32font_driver):
* w32uniscribe.c (uniscribe_font_driver):
* xfont.c (xfont_driver): Related users changed.
* xselect.c (x_get_window_property): Use convenient xmalloc.
Call to xfree only if some data was really allocated.
Diffstat (limited to 'src/xselect.c')
| -rw-r--r-- | src/xselect.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/xselect.c b/src/xselect.c index 89ec1da30b2..f23256346cb 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -1299,9 +1299,7 @@ x_get_window_property (Display *display, Window window, Atom property, | |||
| 1299 | if (total_size_max < bytes_remaining) | 1299 | if (total_size_max < bytes_remaining) |
| 1300 | goto size_overflow; | 1300 | goto size_overflow; |
| 1301 | total_size = bytes_remaining; | 1301 | total_size = bytes_remaining; |
| 1302 | data = malloc (total_size + 1); | 1302 | data = xmalloc (total_size + 1); |
| 1303 | if (! data) | ||
| 1304 | goto memory_exhausted; | ||
| 1305 | 1303 | ||
| 1306 | /* Now read, until we've gotten it all. */ | 1304 | /* Now read, until we've gotten it all. */ |
| 1307 | while (bytes_remaining) | 1305 | while (bytes_remaining) |
| @@ -1352,9 +1350,7 @@ x_get_window_property (Display *display, Window window, Atom property, | |||
| 1352 | if (remaining_lim < 0 || remaining_lim < bytes_remaining) | 1350 | if (remaining_lim < 0 || remaining_lim < bytes_remaining) |
| 1353 | goto size_overflow; | 1351 | goto size_overflow; |
| 1354 | total_size = offset + bytes_gotten + bytes_remaining; | 1352 | total_size = offset + bytes_gotten + bytes_remaining; |
| 1355 | data1 = realloc (data, total_size + 1); | 1353 | data1 = xrealloc (data, total_size + 1); |
| 1356 | if (! data1) | ||
| 1357 | goto memory_exhausted; | ||
| 1358 | data = data1; | 1354 | data = data1; |
| 1359 | } | 1355 | } |
| 1360 | 1356 | ||
| @@ -1386,14 +1382,10 @@ x_get_window_property (Display *display, Window window, Atom property, | |||
| 1386 | return; | 1382 | return; |
| 1387 | 1383 | ||
| 1388 | size_overflow: | 1384 | size_overflow: |
| 1389 | free (data); | 1385 | if (data) |
| 1386 | xfree (data); | ||
| 1390 | unblock_input (); | 1387 | unblock_input (); |
| 1391 | memory_full (SIZE_MAX); | 1388 | memory_full (SIZE_MAX); |
| 1392 | |||
| 1393 | memory_exhausted: | ||
| 1394 | free (data); | ||
| 1395 | unblock_input (); | ||
| 1396 | memory_full (total_size + 1); | ||
| 1397 | } | 1389 | } |
| 1398 | 1390 | ||
| 1399 | /* Use xfree, not XFree, to free the data obtained with this function. */ | 1391 | /* Use xfree, not XFree, to free the data obtained with this function. */ |