fio: fix smalloc strdop allocation failure
authorChristian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Tue, 3 Mar 2015 11:44:46 +0000 (12:44 +0100)
committerJens Axboe <axboe@fb.com>
Tue, 3 Mar 2015 22:00:55 +0000 (15:00 -0700)
commit2894a2d44cfa29c250276853e460b7fb5ea1ef7e
treebcba6ef3160bdd4bbddcd7f33fe6f862d40ed018
parentf52c9691bc8c285f3445235c69acdfd6de7f9b82
fio: fix smalloc strdop allocation failure

smalloc_strdup didn't check for allocation success and thereby ran into
segfaults if the single pool went out of memory.
Now with this patch applied it is still failing, but in a more consistent
way than segfaulting.

You still get a bad allocation, but it looks like this now:
  fio: smalloc OOM
  fio: filesetup.c:1495: dup_files: Assertion `0' failed.
  Aborted

In fact the upper layers expected smalloc_strdup to retrun NULL on failure.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
smalloc.c