What do you mean "validate"? If you want to check whether an allocation succeeded, just check against NULL:
Code:
int *p;
p = malloc(50 * sizeof *p); /* cast is not necessary */
if(p == NULL) { /* oops, the allocation failed */ }
Also, the correct conversion specifier for printing out a pointer is %p, not %u. And here a cast is required to be completely correct, as %p requires a void* (so it follows, of course, that void pointers themselves needn't be cast).
Code:
/* above code, then... */
printf("%p\n", (void *)p);