Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed)

Created:
5 years, 4 months ago by Lei Zhang
Modified:
5 years, 4 months ago
Reviewers:
Tom Sepez, brucedawson
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Don't bother checking pointers before delete[] and FX_Free(). R=tsepez@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/cb62e7657b3a9a04142028a4e6614029a08e894b

Patch Set 1 #

Total comments: 8

Patch Set 2 : nits #

Patch Set 3 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -434 lines) Patch
M core/include/fxcrt/fx_basic.h View 3 chunks +3 lines, -11 lines 0 comments Download
M core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp View 2 chunks +2 lines, -4 lines 0 comments Download
M core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp View 2 chunks +3 lines, -7 lines 0 comments Download
M core/src/fpdfapi/fpdf_font/fpdf_font.cpp View 1 chunk +1 line, -3 lines 0 comments Download
M core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp View 1 1 chunk +3 lines, -9 lines 0 comments Download
M core/src/fpdfapi/fpdf_font/ttgsubtable.h View 1 2 10 chunks +10 lines, -50 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page.cpp View 1 5 chunks +13 lines, -21 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp View 1 3 chunks +4 lines, -12 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp View 1 2 4 chunks +7 lines, -27 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp View 2 chunks +3 lines, -9 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp View 1 3 chunks +3 lines, -9 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp View 1 2 chunks +3 lines, -6 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp View 1 1 chunk +1 line, -3 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp View 1 4 chunks +5 lines, -11 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp View 1 2 2 chunks +2 lines, -7 lines 0 comments Download
M core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp View 1 1 chunk +3 lines, -9 lines 0 comments Download
M core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp View 1 1 chunk +1 line, -3 lines 0 comments Download
M core/src/fpdftext/fpdf_text.cpp View 1 1 chunk +1 line, -3 lines 0 comments Download
M core/src/fxcodec/codec/codec_int.h View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec.cpp View 1 2 2 chunks +2 lines, -6 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_fax.cpp View 1 2 2 chunks +4 lines, -12 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_flate.cpp View 1 2 1 chunk +4 lines, -12 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_icc.cpp View 1 1 chunk +1 line, -3 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_jbig.cpp View 1 3 chunks +3 lines, -9 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_jpeg.cpp View 1 2 2 chunks +2 lines, -6 lines 0 comments Download
M core/src/fxcrt/fx_basic_buffer.cpp View 1 3 chunks +4 lines, -10 lines 0 comments Download
M core/src/fxcrt/fx_basic_maps.cpp View 1 3 chunks +6 lines, -12 lines 0 comments Download
M core/src/fxcrt/xml_int.h View 1 2 1 chunk +1 line, -5 lines 0 comments Download
M core/src/fxge/android/fpf_skiafontmgr.h View 1 2 2 chunks +4 lines, -16 lines 0 comments Download
M core/src/fxge/dib/dib_int.h View 1 1 chunk +1 line, -3 lines 0 comments Download
M core/src/fxge/dib/fx_dib_composite.cpp View 1 2 chunks +6 lines, -18 lines 0 comments Download
M core/src/fxge/dib/fx_dib_convert.cpp View 1 3 chunks +12 lines, -32 lines 0 comments Download
M core/src/fxge/dib/fx_dib_engine.cpp View 1 3 chunks +8 lines, -22 lines 0 comments Download
M core/src/fxge/dib/fx_dib_main.cpp View 1 5 chunks +7 lines, -15 lines 0 comments Download
M core/src/fxge/ge/fx_ge_font.cpp View 1 2 chunks +6 lines, -12 lines 0 comments Download
M core/src/fxge/ge/fx_ge_fontmap.cpp View 1 1 chunk +1 line, -3 lines 0 comments Download
M core/src/fxge/ge/fx_ge_path.cpp View 1 4 chunks +6 lines, -19 lines 0 comments Download
M core/src/fxge/ge/fx_ge_ps.cpp View 1 1 chunk +1 line, -3 lines 0 comments Download
M core/src/fxge/win32/fx_win32_device.cpp View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M core/src/fxge/win32/fx_win32_print.cpp View 1 1 chunk +1 line, -3 lines 0 comments Download
M fpdfsdk/src/fsdk_actionhandler.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M fpdfsdk/src/fsdk_baseform.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 13 (2 generated)
Lei Zhang
5 years, 4 months ago (2015-08-14 19:29:47 UTC) #2
Tom Sepez
+bruce because he knows everything. I thought in old C programs free(null) was not desirable; ...
5 years, 4 months ago (2015-08-14 19:44:29 UTC) #4
brucedawson
I think you are correct, twice. In old C programs free(null) was undefined/illegal, but now ...
5 years, 4 months ago (2015-08-14 20:12:26 UTC) #5
Tom Sepez
lgtm https://codereview.chromium.org/1297713003/diff/1/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp File core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp (right): https://codereview.chromium.org/1297713003/diff/1/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp#newcode304 core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp:304: FX_Free(m_pMapping); nit: indentations. https://codereview.chromium.org/1297713003/diff/1/core/src/fpdfapi/fpdf_font/ttgsubtable.h File core/src/fpdfapi/fpdf_font/ttgsubtable.h (right): https://codereview.chromium.org/1297713003/diff/1/core/src/fpdfapi/fpdf_font/ttgsubtable.h#newcode103 ...
5 years, 4 months ago (2015-08-14 21:21:34 UTC) #6
Lei Zhang
On 2015/08/14 19:44:29, Tom Sepez wrote: > +bruce because he knows everything. > > I ...
5 years, 4 months ago (2015-08-14 21:27:51 UTC) #7
Tom Sepez
On 2015/08/14 21:27:51, Lei Zhang wrote: > On 2015/08/14 19:44:29, Tom Sepez wrote: > > ...
5 years, 4 months ago (2015-08-14 21:33:19 UTC) #8
Lei Zhang
https://codereview.chromium.org/1297713003/diff/1/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp File core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp (right): https://codereview.chromium.org/1297713003/diff/1/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp#newcode304 core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp:304: FX_Free(m_pMapping); On 2015/08/14 21:21:34, Tom Sepez wrote: > nit: ...
5 years, 4 months ago (2015-08-14 21:43:15 UTC) #9
brucedawson
I meant to list my source for the claim that free(NULL) is legal. I searched ...
5 years, 4 months ago (2015-08-14 21:51:22 UTC) #10
Lei Zhang
On 2015/08/14 21:33:19, Tom Sepez wrote: > On 2015/08/14 21:27:51, Lei Zhang wrote: > > ...
5 years, 4 months ago (2015-08-14 21:56:59 UTC) #11
Tom Sepez
> I don't think we have any bizzaros here. Let's land it.
5 years, 4 months ago (2015-08-14 21:58:17 UTC) #12
Lei Zhang
5 years, 4 months ago (2015-08-14 22:45:44 UTC) #13
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
cb62e7657b3a9a04142028a4e6614029a08e894b (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698