Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Issue 6782100: code review 6782100: cmd/gc: check malloc return value (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 8 months ago by jsing
Modified:
12 years, 8 months ago
Reviewers:
CC:
minux1, DMorsing, remyoudompheng, rsc, golang-dev
Visibility:
Public.

Description

cmd/gc: check malloc return value Check the return value from malloc - do not assume that we were allocated memory just because we asked for it. Update issue 4415.

Patch Set 1 #

Patch Set 2 : diff -r f2755950769b https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 9764a39320d8 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 03a6b8c9c396 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -0 lines) Patch
M src/cmd/gc/lex.c View 1 1 chunk +5 lines, -0 lines 0 comments Download
M src/cmd/gc/sinit.c View 1 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 6
minux1
found more unchecked mallocs: https://codereview.appspot.com/6856080
12 years, 8 months ago (2012-11-23 15:09:38 UTC) #1
jsing
Hello minux.ma@gmail.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 8 months ago (2012-11-25 13:08:26 UTC) #2
DMorsing
Why not just use mal()? That function already bails on allocation failure.
12 years, 8 months ago (2012-11-25 14:19:33 UTC) #3
remyoudompheng
because this malloc has a corresponding free. Rémy. 2012/11/25, daniel.morsing@gmail.com <daniel.morsing@gmail.com>: > Why not just ...
12 years, 8 months ago (2012-11-25 14:23:00 UTC) #4
rsc
LGTM
12 years, 8 months ago (2012-11-25 16:21:30 UTC) #5
jsing
12 years, 8 months ago (2012-11-26 11:03:40 UTC) #6
*** Submitted as http://code.google.com/p/go/source/detail?r=3d70c606eb75 ***

cmd/gc: check malloc return value

Check the return value from malloc - do not assume that we were
allocated memory just because we asked for it.

Update issue 4415.

R=minux.ma, daniel.morsing, remyoudompheng, rsc
CC=golang-dev
http://codereview.appspot.com/6782100
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b