Paste C7MyI

Submitted on 6 March 2015 at 12:07 UTC
2253 views

Section 1 (cpp)

int fun(int a)
{
        /* may raise NoEnoughMemoryException */
	vector<char> buf(SIZE);

	if (condition1) {
		while (loop1) {
			...
		}
		return 1;
	}
	...

	return 0;

        /* no need for kfree, buf gets deleted automatically
           on both return statements *and* in case exception is raised */
}

Raw · Download

Pastee