diff options
| author | Richard M. Stallman | 1996-01-25 21:57:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-01-25 21:57:22 +0000 |
| commit | 0158abbc71d93126d98c7a534013e5dc735dc438 (patch) | |
| tree | 367a249d67c89122fe60282cef5c1ac3103e1bf9 /src | |
| parent | 7ab4b7ad3d511be278750cd8b6580c7bd96d353b (diff) | |
| download | emacs-0158abbc71d93126d98c7a534013e5dc735dc438.tar.gz emacs-0158abbc71d93126d98c7a534013e5dc735dc438.zip | |
(x_get_window_property_as_lisp_data): Use xfree, not XFree.
(x_get_window_property): Use XFree for tmp_data.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xselect.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/xselect.c b/src/xselect.c index 32547539538..ead207aedf3 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -211,6 +211,7 @@ x_atom_to_symbol (dpyinfo, display, atom) | |||
| 211 | if (! str) return Qnil; | 211 | if (! str) return Qnil; |
| 212 | val = intern (str); | 212 | val = intern (str); |
| 213 | BLOCK_INPUT; | 213 | BLOCK_INPUT; |
| 214 | /* This was allocated by Xlib, so use XFree. */ | ||
| 214 | XFree (str); | 215 | XFree (str); |
| 215 | UNBLOCK_INPUT; | 216 | UNBLOCK_INPUT; |
| 216 | return val; | 217 | return val; |
| @@ -720,6 +721,8 @@ x_handle_selection_request (event) | |||
| 720 | /* Indicate we have successfully processed this event. */ | 721 | /* Indicate we have successfully processed this event. */ |
| 721 | x_selection_current_request = 0; | 722 | x_selection_current_request = 0; |
| 722 | 723 | ||
| 724 | /* Use xfree, not XFree, because lisp_data_to_selection_data | ||
| 725 | calls xmalloc itself. */ | ||
| 723 | if (!nofree) | 726 | if (!nofree) |
| 724 | xfree (data); | 727 | xfree (data); |
| 725 | } | 728 | } |
| @@ -1152,6 +1155,8 @@ x_get_foreign_selection (selection_symbol, target_type) | |||
| 1152 | 1155 | ||
| 1153 | /* Subroutines of x_get_window_property_as_lisp_data */ | 1156 | /* Subroutines of x_get_window_property_as_lisp_data */ |
| 1154 | 1157 | ||
| 1158 | /* Use xfree, not XFree, to free the data obtained with this function. */ | ||
| 1159 | |||
| 1155 | static void | 1160 | static void |
| 1156 | x_get_window_property (display, window, property, data_ret, bytes_ret, | 1161 | x_get_window_property (display, window, property, data_ret, bytes_ret, |
| 1157 | actual_type_ret, actual_format_ret, actual_size_ret, | 1162 | actual_type_ret, actual_format_ret, actual_size_ret, |
| @@ -1188,7 +1193,8 @@ x_get_window_property (display, window, property, data_ret, bytes_ret, | |||
| 1188 | *bytes_ret = 0; | 1193 | *bytes_ret = 0; |
| 1189 | return; | 1194 | return; |
| 1190 | } | 1195 | } |
| 1191 | xfree ((char *) tmp_data); | 1196 | /* This was allocated by Xlib, so use XFree. */ |
| 1197 | XFree ((char *) tmp_data); | ||
| 1192 | 1198 | ||
| 1193 | if (*actual_type_ret == None || *actual_format_ret == 0) | 1199 | if (*actual_type_ret == None || *actual_format_ret == 0) |
| 1194 | { | 1200 | { |
| @@ -1223,7 +1229,8 @@ x_get_window_property (display, window, property, data_ret, bytes_ret, | |||
| 1223 | *actual_size_ret *= *actual_format_ret / 8; | 1229 | *actual_size_ret *= *actual_format_ret / 8; |
| 1224 | bcopy (tmp_data, (*data_ret) + offset, *actual_size_ret); | 1230 | bcopy (tmp_data, (*data_ret) + offset, *actual_size_ret); |
| 1225 | offset += *actual_size_ret; | 1231 | offset += *actual_size_ret; |
| 1226 | xfree ((char *) tmp_data); | 1232 | /* This was allocated by Xlib, so use XFree. */ |
| 1233 | XFree ((char *) tmp_data); | ||
| 1227 | } | 1234 | } |
| 1228 | 1235 | ||
| 1229 | XFlush (display); | 1236 | XFlush (display); |
| @@ -1231,6 +1238,8 @@ x_get_window_property (display, window, property, data_ret, bytes_ret, | |||
| 1231 | *bytes_ret = offset; | 1238 | *bytes_ret = offset; |
| 1232 | } | 1239 | } |
| 1233 | 1240 | ||
| 1241 | /* Use xfree, not XFree, to free the data obtained with this function. */ | ||
| 1242 | |||
| 1234 | static void | 1243 | static void |
| 1235 | receive_incremental_selection (display, window, property, target_type, | 1244 | receive_incremental_selection (display, window, property, target_type, |
| 1236 | min_size_bytes, data_ret, size_bytes_ret, | 1245 | min_size_bytes, data_ret, size_bytes_ret, |
| @@ -1291,6 +1300,8 @@ receive_incremental_selection (display, window, property, target_type, | |||
| 1291 | if (! waiting_for_other_props_on_window (display, window)) | 1300 | if (! waiting_for_other_props_on_window (display, window)) |
| 1292 | XSelectInput (display, window, STANDARD_EVENT_SET); | 1301 | XSelectInput (display, window, STANDARD_EVENT_SET); |
| 1293 | unexpect_property_change (wait_object); | 1302 | unexpect_property_change (wait_object); |
| 1303 | /* Use xfree, not XFree, because x_get_window_property | ||
| 1304 | calls xmalloc itself. */ | ||
| 1294 | if (tmp_data) xfree (tmp_data); | 1305 | if (tmp_data) xfree (tmp_data); |
| 1295 | break; | 1306 | break; |
| 1296 | } | 1307 | } |
| @@ -1316,6 +1327,8 @@ receive_incremental_selection (display, window, property, target_type, | |||
| 1316 | } | 1327 | } |
| 1317 | bcopy (tmp_data, (*data_ret) + offset, tmp_size_bytes); | 1328 | bcopy (tmp_data, (*data_ret) + offset, tmp_size_bytes); |
| 1318 | offset += tmp_size_bytes; | 1329 | offset += tmp_size_bytes; |
| 1330 | /* Use xfree, not XFree, because x_get_window_property | ||
| 1331 | calls xmalloc itself. */ | ||
| 1319 | xfree (tmp_data); | 1332 | xfree (tmp_data); |
| 1320 | } | 1333 | } |
| 1321 | } | 1334 | } |
| @@ -1372,7 +1385,9 @@ x_get_window_property_as_lisp_data (display, window, property, target_type, | |||
| 1372 | 1385 | ||
| 1373 | unsigned int min_size_bytes = * ((unsigned int *) data); | 1386 | unsigned int min_size_bytes = * ((unsigned int *) data); |
| 1374 | BLOCK_INPUT; | 1387 | BLOCK_INPUT; |
| 1375 | XFree ((char *) data); | 1388 | /* Use xfree, not XFree, because x_get_window_property |
| 1389 | calls xmalloc itself. */ | ||
| 1390 | xfree ((char *) data); | ||
| 1376 | UNBLOCK_INPUT; | 1391 | UNBLOCK_INPUT; |
| 1377 | receive_incremental_selection (display, window, property, target_type, | 1392 | receive_incremental_selection (display, window, property, target_type, |
| 1378 | min_size_bytes, &data, &bytes, | 1393 | min_size_bytes, &data, &bytes, |
| @@ -1390,6 +1405,8 @@ x_get_window_property_as_lisp_data (display, window, property, target_type, | |||
| 1390 | val = selection_data_to_lisp_data (display, data, bytes, | 1405 | val = selection_data_to_lisp_data (display, data, bytes, |
| 1391 | actual_type, actual_format); | 1406 | actual_type, actual_format); |
| 1392 | 1407 | ||
| 1408 | /* Use xfree, not XFree, because x_get_window_property | ||
| 1409 | calls xmalloc itself. */ | ||
| 1393 | xfree ((char *) data); | 1410 | xfree ((char *) data); |
| 1394 | return val; | 1411 | return val; |
| 1395 | } | 1412 | } |
| @@ -1492,6 +1509,8 @@ selection_data_to_lisp_data (display, data, size, type, format) | |||
| 1492 | } | 1509 | } |
| 1493 | 1510 | ||
| 1494 | 1511 | ||
| 1512 | /* Use xfree, not XFree, to free the data obtained with this function. */ | ||
| 1513 | |||
| 1495 | static void | 1514 | static void |
| 1496 | lisp_data_to_selection_data (display, obj, | 1515 | lisp_data_to_selection_data (display, obj, |
| 1497 | data_ret, type_ret, size_ret, | 1516 | data_ret, type_ret, size_ret, |
| @@ -1977,6 +1996,8 @@ DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal, | |||
| 1977 | Fcons (make_number (format), Qnil)))); | 1996 | Fcons (make_number (format), Qnil)))); |
| 1978 | 1997 | ||
| 1979 | ret = (bytes ? make_string ((char *) data, bytes) : Qnil); | 1998 | ret = (bytes ? make_string ((char *) data, bytes) : Qnil); |
| 1999 | /* Use xfree, not XFree, because x_get_window_property | ||
| 2000 | calls xmalloc itself. */ | ||
| 1980 | xfree (data); | 2001 | xfree (data); |
| 1981 | return ret; | 2002 | return ret; |
| 1982 | } | 2003 | } |